Java Code Examples for org.apache.hadoop.hdfs.protocol.ClientProtocol#GET_STATS_UNDER_REPLICATED_IDX

The following examples show how to use org.apache.hadoop.hdfs.protocol.ClientProtocol#GET_STATS_UNDER_REPLICATED_IDX . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PBHelper.java    From hadoop with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example 2
Source File: PBHelper.java    From big-c with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example 3
Source File: PBHelper.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public static long[] convert(GetFsStatsResponseProto res) {
  long[] result = new long[7];
  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();
  return result;
}
 
Example 4
Source File: PBHelper.java    From big-c with Apache License 2.0 5 votes vote down vote up
public static long[] convert(GetFsStatsResponseProto res) {
  long[] result = new long[7];
  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();
  return result;
}
 
Example 5
Source File: DFSClient.java    From hadoop with Apache License 2.0 2 votes vote down vote up
/**
 * Returns count of blocks with one of more replica missing.
 * @throws IOException
 */ 
public long getUnderReplicatedBlocksCount() throws IOException {
  return callGetStats()[ClientProtocol.GET_STATS_UNDER_REPLICATED_IDX];
}
 
Example 6
Source File: DFSClient.java    From big-c with Apache License 2.0 2 votes vote down vote up
/**
 * Returns count of blocks with one of more replica missing.
 * @throws IOException
 */ 
public long getUnderReplicatedBlocksCount() throws IOException {
  return callGetStats()[ClientProtocol.GET_STATS_UNDER_REPLICATED_IDX];
}
 
Example 7
Source File: DFSClient.java    From RDFS with Apache License 2.0 2 votes vote down vote up
/**
 * Returns count of blocks with one of more replica missing.
 * @throws IOException
 */
public long getUnderReplicatedBlocksCount() throws IOException {
  return namenode.getStats()[ClientProtocol.GET_STATS_UNDER_REPLICATED_IDX];
}