本文整理汇总了Java中org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.NamespaceInfoProto类的典型用法代码示例。如果您正苦于以下问题:Java NamespaceInfoProto类的具体用法?Java NamespaceInfoProto怎么用?Java NamespaceInfoProto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NamespaceInfoProto类属于org.apache.hadoop.hdfs.protocol.proto.HdfsProtos包,在下文中一共展示了NamespaceInfoProto类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.NamespaceInfoProto; //导入依赖的package包/类
public static NamespaceInfoProto convert(NamespaceInfo info) {
return NamespaceInfoProto.newBuilder()
.setBlockPoolID(info.getBlockPoolID())
.setBuildVersion(info.getBuildVersion())
.setUnused(0)
.setStorageInfo(PBHelper.convert((StorageInfo)info))
.setSoftwareVersion(info.getSoftwareVersion())
.setCapabilities(info.getCapabilities())
.build();
}
示例2: testConvertNamespaceInfo
import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.NamespaceInfoProto; //导入依赖的package包/类
@Test
public void testConvertNamespaceInfo() {
NamespaceInfo info = new NamespaceInfo(37, "clusterID", "bpID", 2300);
NamespaceInfoProto proto = PBHelper.convert(info);
NamespaceInfo info2 = PBHelper.convert(proto);
compare(info, info2); //Compare the StorageInfo
assertEquals(info.getBlockPoolID(), info2.getBlockPoolID());
assertEquals(info.getBuildVersion(), info2.getBuildVersion());
}
示例3: convert
import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.NamespaceInfoProto; //导入依赖的package包/类
public static NamespaceInfoProto convert(NamespaceInfo info) {
return NamespaceInfoProto.newBuilder()
.setBlockPoolID(info.getBlockPoolID())
.setBuildVersion(info.getBuildVersion())
.setUnused(0)
.setStorageInfo(PBHelper.convert((StorageInfo)info))
.setSoftwareVersion(info.getSoftwareVersion()).build();
}
示例4: convert
import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.NamespaceInfoProto; //导入依赖的package包/类
public static NamespaceInfo convert(NamespaceInfoProto info) {
StorageInfoProto storage = info.getStorageInfo();
return new NamespaceInfo(storage.getNamespceID(), storage.getClusterID(),
info.getBlockPoolID(), storage.getCTime(), info.getBuildVersion(),
info.getSoftwareVersion());
}