Java 类org.apache.hadoop.hdfs.server.namenode.FsImageProto.SnapshotSection 实例源码

项目:hadoop    文件:FSImageFormatPBSnapshot.java   
/**
 * Load the snapshots section from fsimage. Also add snapshottable feature
 * to snapshottable directories.
 */
public void loadSnapshotSection(InputStream in) throws IOException {
  SnapshotManager sm = fsn.getSnapshotManager();
  SnapshotSection section = SnapshotSection.parseDelimitedFrom(in);
  int snum = section.getNumSnapshots();
  sm.setNumSnapshots(snum);
  sm.setSnapshotCounter(section.getSnapshotCounter());
  for (long sdirId : section.getSnapshottableDirList()) {
    INodeDirectory dir = fsDir.getInode(sdirId).asDirectory();
    if (!dir.isSnapshottable()) {
      dir.addSnapshottableFeature();
    } else {
      // dir is root, and admin set root to snapshottable before
      dir.setSnapshotQuota(DirectorySnapshottableFeature.SNAPSHOT_LIMIT);
    }
    sm.addSnapshottable(dir);
  }
  loadSnapshots(in, snum);
}
项目:hadoop    文件:PBImageXmlWriter.java   
private void dumpSnapshotSection(InputStream in) throws IOException {
  out.print("<SnapshotSection>");
  SnapshotSection s = SnapshotSection.parseDelimitedFrom(in);
  o("snapshotCounter", s.getSnapshotCounter());
  if (s.getSnapshottableDirCount() > 0) {
    out.print("<snapshottableDir>");
    for (long id : s.getSnapshottableDirList()) {
      o("dir", id);
    }
    out.print("</snapshottableDir>\n");
  }
  for (int i = 0; i < s.getNumSnapshots(); ++i) {
    SnapshotSection.Snapshot pbs = SnapshotSection.Snapshot
        .parseDelimitedFrom(in);
    o("snapshot", pbs.getSnapshotId());
  }
  out.print("</SnapshotSection>\n");
}
项目:aliyun-oss-hadoop-fs    文件:FSImageFormatPBSnapshot.java   
/**
 * Load the snapshots section from fsimage. Also add snapshottable feature
 * to snapshottable directories.
 */
public void loadSnapshotSection(InputStream in) throws IOException {
  SnapshotManager sm = fsn.getSnapshotManager();
  SnapshotSection section = SnapshotSection.parseDelimitedFrom(in);
  int snum = section.getNumSnapshots();
  sm.setNumSnapshots(snum);
  sm.setSnapshotCounter(section.getSnapshotCounter());
  for (long sdirId : section.getSnapshottableDirList()) {
    INodeDirectory dir = fsDir.getInode(sdirId).asDirectory();
    if (!dir.isSnapshottable()) {
      dir.addSnapshottableFeature();
    } else {
      // dir is root, and admin set root to snapshottable before
      dir.setSnapshotQuota(DirectorySnapshottableFeature.SNAPSHOT_LIMIT);
    }
    sm.addSnapshottable(dir);
  }
  loadSnapshots(in, snum);
}
项目:aliyun-oss-hadoop-fs    文件:PBImageXmlWriter.java   
private void dumpSnapshotSection(InputStream in) throws IOException {
  out.print("<SnapshotSection>");
  SnapshotSection s = SnapshotSection.parseDelimitedFrom(in);
  o("snapshotCounter", s.getSnapshotCounter());
  if (s.getSnapshottableDirCount() > 0) {
    out.print("<snapshottableDir>");
    for (long id : s.getSnapshottableDirList()) {
      o("dir", id);
    }
    out.print("</snapshottableDir>\n");
  }
  for (int i = 0; i < s.getNumSnapshots(); ++i) {
    SnapshotSection.Snapshot pbs = SnapshotSection.Snapshot
        .parseDelimitedFrom(in);
    o("snapshot", pbs.getSnapshotId());
  }
  out.print("</SnapshotSection>\n");
}
项目:big-c    文件:FSImageFormatPBSnapshot.java   
/**
 * Load the snapshots section from fsimage. Also add snapshottable feature
 * to snapshottable directories.
 */
public void loadSnapshotSection(InputStream in) throws IOException {
  SnapshotManager sm = fsn.getSnapshotManager();
  SnapshotSection section = SnapshotSection.parseDelimitedFrom(in);
  int snum = section.getNumSnapshots();
  sm.setNumSnapshots(snum);
  sm.setSnapshotCounter(section.getSnapshotCounter());
  for (long sdirId : section.getSnapshottableDirList()) {
    INodeDirectory dir = fsDir.getInode(sdirId).asDirectory();
    if (!dir.isSnapshottable()) {
      dir.addSnapshottableFeature();
    } else {
      // dir is root, and admin set root to snapshottable before
      dir.setSnapshotQuota(DirectorySnapshottableFeature.SNAPSHOT_LIMIT);
    }
    sm.addSnapshottable(dir);
  }
  loadSnapshots(in, snum);
}
项目:big-c    文件:PBImageXmlWriter.java   
private void dumpSnapshotSection(InputStream in) throws IOException {
  out.print("<SnapshotSection>");
  SnapshotSection s = SnapshotSection.parseDelimitedFrom(in);
  o("snapshotCounter", s.getSnapshotCounter());
  if (s.getSnapshottableDirCount() > 0) {
    out.print("<snapshottableDir>");
    for (long id : s.getSnapshottableDirList()) {
      o("dir", id);
    }
    out.print("</snapshottableDir>\n");
  }
  for (int i = 0; i < s.getNumSnapshots(); ++i) {
    SnapshotSection.Snapshot pbs = SnapshotSection.Snapshot
        .parseDelimitedFrom(in);
    o("snapshot", pbs.getSnapshotId());
  }
  out.print("</SnapshotSection>\n");
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FSImageFormatPBSnapshot.java   
/**
 * Load the snapshots section from fsimage. Also add snapshottable feature
 * to snapshottable directories.
 */
public void loadSnapshotSection(InputStream in) throws IOException {
  SnapshotManager sm = fsn.getSnapshotManager();
  SnapshotSection section = SnapshotSection.parseDelimitedFrom(in);
  int snum = section.getNumSnapshots();
  sm.setNumSnapshots(snum);
  sm.setSnapshotCounter(section.getSnapshotCounter());
  for (long sdirId : section.getSnapshottableDirList()) {
    INodeDirectory dir = fsDir.getInode(sdirId).asDirectory();
    if (!dir.isSnapshottable()) {
      dir.addSnapshottableFeature();
    } else {
      // dir is root, and admin set root to snapshottable before
      dir.setSnapshotQuota(DirectorySnapshottableFeature.SNAPSHOT_LIMIT);
    }
    sm.addSnapshottable(dir);
  }
  loadSnapshots(in, snum);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBImageXmlWriter.java   
private void dumpSnapshotSection(InputStream in) throws IOException {
  out.print("<SnapshotSection>");
  SnapshotSection s = SnapshotSection.parseDelimitedFrom(in);
  o("snapshotCounter", s.getSnapshotCounter());
  if (s.getSnapshottableDirCount() > 0) {
    out.print("<snapshottableDir>");
    for (long id : s.getSnapshottableDirList()) {
      o("dir", id);
    }
    out.print("</snapshottableDir>\n");
  }
  for (int i = 0; i < s.getNumSnapshots(); ++i) {
    SnapshotSection.Snapshot pbs = SnapshotSection.Snapshot
        .parseDelimitedFrom(in);
    o("snapshot", pbs.getSnapshotId());
  }
  out.print("</SnapshotSection>\n");
}
项目:FlexMap    文件:FSImageFormatPBSnapshot.java   
/**
 * Load the snapshots section from fsimage. Also add snapshottable feature
 * to snapshottable directories.
 */
public void loadSnapshotSection(InputStream in) throws IOException {
  SnapshotManager sm = fsn.getSnapshotManager();
  SnapshotSection section = SnapshotSection.parseDelimitedFrom(in);
  int snum = section.getNumSnapshots();
  sm.setNumSnapshots(snum);
  sm.setSnapshotCounter(section.getSnapshotCounter());
  for (long sdirId : section.getSnapshottableDirList()) {
    INodeDirectory dir = fsDir.getInode(sdirId).asDirectory();
    if (!dir.isSnapshottable()) {
      dir.addSnapshottableFeature();
    } else {
      // dir is root, and admin set root to snapshottable before
      dir.setSnapshotQuota(DirectorySnapshottableFeature.SNAPSHOT_LIMIT);
    }
    sm.addSnapshottable(dir);
  }
  loadSnapshots(in, snum);
}
项目:FlexMap    文件:PBImageXmlWriter.java   
private void dumpSnapshotSection(InputStream in) throws IOException {
  out.print("<SnapshotSection>");
  SnapshotSection s = SnapshotSection.parseDelimitedFrom(in);
  o("snapshotCounter", s.getSnapshotCounter());
  if (s.getSnapshottableDirCount() > 0) {
    out.print("<snapshottableDir>");
    for (long id : s.getSnapshottableDirList()) {
      o("dir", id);
    }
    out.print("</snapshottableDir>\n");
  }
  for (int i = 0; i < s.getNumSnapshots(); ++i) {
    SnapshotSection.Snapshot pbs = SnapshotSection.Snapshot
        .parseDelimitedFrom(in);
    o("snapshot", pbs.getSnapshotId());
  }
  out.print("</SnapshotSection>\n");
}
项目:hadoop-on-lustre2    文件:FSImageFormatPBSnapshot.java   
/**
 * Load the snapshots section from fsimage. Also convert snapshottable
 * directories into {@link INodeDirectorySnapshottable}.
 *
 */
public void loadSnapshotSection(InputStream in) throws IOException {
  SnapshotManager sm = fsn.getSnapshotManager();
  SnapshotSection section = SnapshotSection.parseDelimitedFrom(in);
  int snum = section.getNumSnapshots();
  sm.setNumSnapshots(snum);
  sm.setSnapshotCounter(section.getSnapshotCounter());
  for (long sdirId : section.getSnapshottableDirList()) {
    INodeDirectory dir = fsDir.getInode(sdirId).asDirectory();
    final INodeDirectorySnapshottable sdir;
    if (!dir.isSnapshottable()) {
      sdir = new INodeDirectorySnapshottable(dir);
      fsDir.addToInodeMap(sdir);
    } else {
      // dir is root, and admin set root to snapshottable before
      sdir = (INodeDirectorySnapshottable) dir;
      sdir.setSnapshotQuota(INodeDirectorySnapshottable.SNAPSHOT_LIMIT);
    }
    sm.addSnapshottable(sdir);
  }
  loadSnapshots(in, snum);
}
项目:hadoop-on-lustre2    文件:PBImageXmlWriter.java   
private void dumpSnapshotSection(InputStream in) throws IOException {
  out.print("<SnapshotSection>");
  SnapshotSection s = SnapshotSection.parseDelimitedFrom(in);
  o("snapshotCounter", s.getSnapshotCounter());
  if (s.getSnapshottableDirCount() > 0) {
    out.print("<snapshottableDir>");
    for (long id : s.getSnapshottableDirList()) {
      o("dir", id);
    }
    out.print("</snapshottableDir>\n");
  }
  for (int i = 0; i < s.getNumSnapshots(); ++i) {
    SnapshotSection.Snapshot pbs = SnapshotSection.Snapshot
        .parseDelimitedFrom(in);
    o("snapshot", pbs.getSnapshotId());
  }
  out.print("</SnapshotSection>\n");
}