本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.FsImageProto.SnapshotSection类的典型用法代码示例。如果您正苦于以下问题:Java SnapshotSection类的具体用法?Java SnapshotSection怎么用?Java SnapshotSection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SnapshotSection类属于org.apache.hadoop.hdfs.server.namenode.FsImageProto包,在下文中一共展示了SnapshotSection类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadSnapshotSection
import org.apache.hadoop.hdfs.server.namenode.FsImageProto.SnapshotSection; //导入依赖的package包/类
/**
* 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);
}
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:FSImageFormatPBSnapshot.java
示例2: dumpSnapshotSection
import org.apache.hadoop.hdfs.server.namenode.FsImageProto.SnapshotSection; //导入依赖的package包/类
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");
}
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:PBImageXmlWriter.java
示例3: loadSnapshotSection
import org.apache.hadoop.hdfs.server.namenode.FsImageProto.SnapshotSection; //导入依赖的package包/类
/**
* 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);
}
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:27,代码来源:FSImageFormatPBSnapshot.java
注:本文中的org.apache.hadoop.hdfs.server.namenode.FsImageProto.SnapshotSection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论