当前位置: 首页>>代码示例>>Java>>正文


Java ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX属性代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.protocol.ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX属性的典型用法代码示例。如果您正苦于以下问题:Java ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX属性的具体用法?Java ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX怎么用?Java ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hdfs.protocol.ClientProtocol的用法示例。


在下文中一共展示了ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convert

public static GetFsStatsResponseProto convert(long[] fsStats) {
  GetFsStatsResponseProto.Builder result = GetFsStatsResponseProto
      .newBuilder();
  if (fsStats.length >= ClientProtocol.GET_STATS_CAPACITY_IDX + 1)
    result.setCapacity(fsStats[ClientProtocol.GET_STATS_CAPACITY_IDX]);
  if (fsStats.length >= ClientProtocol.GET_STATS_USED_IDX + 1)
    result.setUsed(fsStats[ClientProtocol.GET_STATS_USED_IDX]);
  if (fsStats.length >= ClientProtocol.GET_STATS_REMAINING_IDX + 1)
    result.setRemaining(fsStats[ClientProtocol.GET_STATS_REMAINING_IDX]);
  if (fsStats.length >= ClientProtocol.GET_STATS_UNDER_REPLICATED_IDX + 1)
    result.setUnderReplicated(
            fsStats[ClientProtocol.GET_STATS_UNDER_REPLICATED_IDX]);
  if (fsStats.length >= ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX + 1)
    result.setCorruptBlocks(
        fsStats[ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX]);
  if (fsStats.length >= ClientProtocol.GET_STATS_MISSING_BLOCKS_IDX + 1)
    result.setMissingBlocks(
        fsStats[ClientProtocol.GET_STATS_MISSING_BLOCKS_IDX]);
  if (fsStats.length >= ClientProtocol.GET_STATS_MISSING_REPL_ONE_BLOCKS_IDX + 1)
    result.setMissingReplOneBlocks(
        fsStats[ClientProtocol.GET_STATS_MISSING_REPL_ONE_BLOCKS_IDX]);
  return result.build();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:PBHelper.java

示例2: convert

public static long[] convert(GetFsStatsResponseProto res) {
  long[] result = new long[ClientProtocol.STATS_ARRAY_LENGTH];
  result[ClientProtocol.GET_STATS_CAPACITY_IDX] = res.getCapacity();
  result[ClientProtocol.GET_STATS_USED_IDX] = res.getUsed();
  result[ClientProtocol.GET_STATS_REMAINING_IDX] = res.getRemaining();
  result[ClientProtocol.GET_STATS_UNDER_REPLICATED_IDX] =
      res.getUnderReplicated();
  result[ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX] =
      res.getCorruptBlocks();
  result[ClientProtocol.GET_STATS_MISSING_BLOCKS_IDX] =
      res.getMissingBlocks();
  result[ClientProtocol.GET_STATS_MISSING_REPL_ONE_BLOCKS_IDX] =
      res.getMissingReplOneBlocks();
  result[ClientProtocol.GET_STATS_BYTES_IN_FUTURE_BLOCKS_IDX] =
      res.hasBlocksInFuture() ? res.getBlocksInFuture() : 0;
  return result;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:17,代码来源:PBHelperClient.java

示例3: getStats

/** @see ClientProtocol#getStats() */
long[] getStats() {
  final long[] stats = datanodeStatistics.getStats();
  stats[ClientProtocol.GET_STATS_UNDER_REPLICATED_IDX] = getUnderReplicatedBlocks();
  stats[ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX] = getCorruptReplicaBlocks();
  stats[ClientProtocol.GET_STATS_MISSING_BLOCKS_IDX] = getMissingBlocksCount();
  stats[ClientProtocol.GET_STATS_MISSING_REPL_ONE_BLOCKS_IDX] =
      getMissingReplOneBlocksCount();
  return stats;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:FSNamesystem.java

示例4: getStats

/** @see ClientProtocol#getStats() */
long[] getStats() {
  final long[] stats = datanodeStatistics.getStats();
  stats[ClientProtocol.GET_STATS_UNDER_REPLICATED_IDX] = getUnderReplicatedBlocks();
  stats[ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX] = getCorruptReplicaBlocks();
  stats[ClientProtocol.GET_STATS_MISSING_BLOCKS_IDX] = getMissingBlocksCount();
  stats[ClientProtocol.GET_STATS_MISSING_REPL_ONE_BLOCKS_IDX] =
      getMissingReplOneBlocksCount();
  stats[ClientProtocol.GET_STATS_BYTES_IN_FUTURE_BLOCKS_IDX] =
      blockManager.getBytesInFuture();
  return stats;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:12,代码来源:FSNamesystem.java

示例5: getCorruptBlocksCount

/**
 * Returns count of blocks with at least one replica marked corrupt. 
 * @throws IOException
 */ 
public long getCorruptBlocksCount() throws IOException {
  return callGetStats()[ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX];
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:DFSClient.java

示例6: getCorruptBlocksCount

/**
 * Returns count of blocks with at least one replica marked corrupt.
 * @throws IOException
 */
public long getCorruptBlocksCount() throws IOException {
  return callGetStats()[ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX];
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:7,代码来源:DFSClient.java


注:本文中的org.apache.hadoop.hdfs.protocol.ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。