Skip to content
Merged
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 @@ -133,13 +133,24 @@ public boolean evaluate() throws Exception {
* @param greaterThan size of replicationLoadSourceList must be greater before we proceed
*/
private List<ReplicationLoadSource> waitOnMetricsReport(int greaterThan, ServerName serverName)
throws IOException {
ClusterMetrics metrics = hbaseAdmin.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS));
List<ReplicationLoadSource> list =
metrics.getLiveServerMetrics().get(serverName).getReplicationLoadSourceList();
while (list.size() <= greaterThan) {
Threads.sleep(1000);
}
return list;
throws Exception {
UTIL1.waitFor(30000, 1000, new Waiter.ExplainingPredicate<Exception>() {
@Override
public boolean evaluate() throws Exception {
List<ReplicationLoadSource> list =
hbaseAdmin.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS)).getLiveServerMetrics()
.get(serverName).getReplicationLoadSourceList();
return list.size() > greaterThan;
}

@Override
public String explainFailure() throws Exception {
return "The ReplicationLoadSourceList's size is lesser than or equal to " + greaterThan
+ " for " + serverName;
}
});

return hbaseAdmin.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS)).getLiveServerMetrics()
.get(serverName).getReplicationLoadSourceList();
}
}