• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BlockStoragePolicyProto类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockStoragePolicyProto的典型用法代码示例。如果您正苦于以下问题:Java BlockStoragePolicyProto类的具体用法?Java BlockStoragePolicyProto怎么用?Java BlockStoragePolicyProto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

BlockStoragePolicyProto类属于org.apache.hadoop.hdfs.protocol.proto.HdfsProtos包,在下文中一共展示了BlockStoragePolicyProto类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: convert

点赞 3

import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockStoragePolicyProto; //导入依赖的package包/类
public static BlockStoragePolicyProto convert(BlockStoragePolicy policy) {
  BlockStoragePolicyProto.Builder builder = BlockStoragePolicyProto
      .newBuilder().setPolicyId(policy.getId()).setName(policy.getName());
  // creation storage types
  StorageTypesProto creationProto = convert(policy.getStorageTypes());
  Preconditions.checkArgument(creationProto != null);
  builder.setCreationPolicy(creationProto);
  // creation fallback
  StorageTypesProto creationFallbackProto = convert(
      policy.getCreationFallbacks());
  if (creationFallbackProto != null) {
    builder.setCreationFallbackPolicy(creationFallbackProto);
  }
  // replication fallback
  StorageTypesProto replicationFallbackProto = convert(
      policy.getReplicationFallbacks());
  if (replicationFallbackProto != null) {
    builder.setReplicationFallbackPolicy(replicationFallbackProto);
  }
  return builder.build();
}
 

开发者ID:naver,
项目名称:hadoop,
代码行数:22,
代码来源:PBHelper.java

示例2: convertStoragePolicies

点赞 2

import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockStoragePolicyProto; //导入依赖的package包/类
public static BlockStoragePolicy[] convertStoragePolicies(
    List<BlockStoragePolicyProto> policyProtos) {
  if (policyProtos == null || policyProtos.size() == 0) {
    return new BlockStoragePolicy[0];
  }
  BlockStoragePolicy[] policies = new BlockStoragePolicy[policyProtos.size()];
  int i = 0;
  for (BlockStoragePolicyProto proto : policyProtos) {
    policies[i++] = convert(proto);
  }
  return policies;
}
 

开发者ID:naver,
项目名称:hadoop,
代码行数:13,
代码来源:PBHelper.java

示例3: getStoragePolicy

点赞 2

import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockStoragePolicyProto; //导入依赖的package包/类
@Override
public GetStoragePolicyResponseProto getStoragePolicy(
    RpcController controller, GetStoragePolicyRequestProto request)
    throws ServiceException {
  try {
    BlockStoragePolicyProto policy = PBHelperClient.convert(server
        .getStoragePolicy(request.getPath()));
    return GetStoragePolicyResponseProto.newBuilder()
        .setStoragePolicy(policy).build();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
 

开发者ID:aliyun-beta,
项目名称:aliyun-oss-hadoop-fs,
代码行数:14,
代码来源:ClientNamenodeProtocolServerSideTranslatorPB.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)