Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2103,11 +2103,29 @@
GET_STATS_CORRUPT_BLOCKS_IDX);
}

/**
* Returns count of blocks with one or more replicas missing.
* @throws IOException
*/
public long getNormalLowRedundancyBlocksCount() throws IOException {

Check failure on line 2110 in hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java

View check run for this annotation

ASF Cloudbees Jenkins ci-hadoop / Apache Yetus

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java#L2110

javadoc: warning: no @return
return getStateByIndex(ClientProtocol.
GET_STATS_NORMAL_LOW_REDUNDANCY_BLOCKS_IDX);
}

/**
* Returns count of blocks that are badly distributed as per BPP.
* @throws IOException

Check failure on line 2117 in hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java

View check run for this annotation

ASF Cloudbees Jenkins ci-hadoop / Apache Yetus

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java#L2117

javadoc: warning: no description for @throws
*/
public long getBadlyDistributedBlocksCount() throws IOException {

Check failure on line 2119 in hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java

View check run for this annotation

ASF Cloudbees Jenkins ci-hadoop / Apache Yetus

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java#L2119

javadoc: warning: no @return
return getStateByIndex(ClientProtocol.
GET_STATS_BADLY_DISTRIBUTED_BLOCKS_IDX);
}

/**
* Returns number of bytes that reside in Blocks with future generation
* stamps.
* @return Bytes in Blocks with future generation stamps.
* @throws IOException

Check failure on line 2128 in hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java

View check run for this annotation

ASF Cloudbees Jenkins ci-hadoop / Apache Yetus

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java#L2128

javadoc: warning: no description for @throws
*/
public long getBytesInFutureBlocks() throws IOException {
return getStateByIndex(ClientProtocol.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,9 @@ SnapshotStatus[] getSnapshotListing(String snapshotRoot)
int GET_STATS_MISSING_REPL_ONE_BLOCKS_IDX = 6;
int GET_STATS_BYTES_IN_FUTURE_BLOCKS_IDX = 7;
int GET_STATS_PENDING_DELETION_BLOCKS_IDX = 8;
int STATS_ARRAY_LENGTH = 9;
int GET_STATS_BADLY_DISTRIBUTED_BLOCKS_IDX = 9;
int GET_STATS_NORMAL_LOW_REDUNDANCY_BLOCKS_IDX = 10;
int STATS_ARRAY_LENGTH = 11;

/**
* Get an array of aggregated statistics combining blocks of both type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ public synchronized long[] getStats() {
-1L,
-1L,
-1L,
-1L,
-1L,
-1L};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4848,6 +4848,13 @@ long[] getStats() {
blockManager.getBytesInFuture();
stats[ClientProtocol.GET_STATS_PENDING_DELETION_BLOCKS_IDX] =
blockManager.getPendingDeletionBlocksCount();
stats[ClientProtocol.GET_STATS_BADLY_DISTRIBUTED_BLOCKS_IDX] =
getBadlyDistributedBlocksCount();
// GET_STATS_LOW_REDUNDANCY_IDX uses getLowRedundancyBlocksCount() which gives us the count of
// all types of low redundancy blocks. GET_STATS_NORMAL_LOW_REDUNDANCY_BLOCKS_IDX will give the count
// of normal low redundancy blocks only using getLowRedundancyBlocks().
stats[ClientProtocol.GET_STATS_NORMAL_LOW_REDUNDANCY_BLOCKS_IDX] =
blockManager.getLowRedundancyBlocks();
return stats;
}

Expand Down