ClientProtocol.getStats() return 7 types of statistics information.
/**
* Get a setof statistics aboutthe filesystem.
* Right now, only seven values are returned.
* <ul>
* <li> [0] containsthe total storage capacity ofthe system, in bytes.</li>
* <li> [1] containsthe total used spaceofthe system, in bytes.</li>
* <li> [2] containsthe available storage ofthe system, in bytes.</li>
* <li> [3] containsnumberof under replicated blocks inthe system.</li>
* <li> [4] containsnumberof blocks with a corrupt replica. </li>
* <li> [5] containsnumberof blocks without any good replicas left. </li>
* <li> [6] containsnumberof blocks which have replication factor
* 1and have lost the only replica. </li>
* </ul>
* Use public constants like {@link #GET_STATS_CAPACITY_IDX} in place of
* actual numbers to index intothe array.
*/
@Idempotent
public long[] getStats() throws IOException;
DFSClient separates the statistics use different methods.
/**
* @see ClientProtocol#getStats()
*/public FsStatus getDiskStatus() throws IOException {
long rawNums[] = callGetStats();
returnnew FsStatus(rawNums[0], rawNums[1], rawNums[2]);
}
/**
* Returns count of blocks with no good replicas left. Normally should be
* zero.
* @throws IOException
*/publiclonggetMissingBlocksCount() throws IOException {
return callGetStats()[ClientProtocol.GET_STATS_MISSING_BLOCKS_IDX];
}
/**
* Returns count of blocks with replication factor 1 and have
* lost the only replica.
* @throws IOException
*/publiclonggetMissingReplOneBlocksCount() throws IOException {
return callGetStats()[ClientProtocol.
GET_STATS_MISSING_REPL_ONE_BLOCKS_IDX];
}
/**
* Returns count of blocks with one of more replica missing.
* @throws IOException
*/publiclonggetUnderReplicatedBlocksCount() throws IOException {
return callGetStats()[ClientProtocol.GET_STATS_UNDER_REPLICATED_IDX];
}
/**
* Returns count of blocks with at least one replica marked corrupt.
* @throws IOException
*/publiclonggetCorruptBlocksCount() throws IOException {
return callGetStats()[ClientProtocol.GET_STATS_CORRUPT_BLOCKS_IDX];
}