HBASE-25884 Return empty records for disabled balancer in-memory queue (#3263)

Signed-off-by: stack <stack@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Aman Poonia <apoonia@salesforce.com>
This commit is contained in:
Viraj Jasani 2021-05-14 12:54:07 +05:30
parent 1c829af56a
commit 112b58ad8c
No known key found for this signature in database
GPG Key ID: 08E70F70AB71C5A1
1 changed files with 6 additions and 4 deletions

View File

@ -3080,8 +3080,9 @@ public class MasterRpcServices extends RSRpcServices implements
namedQueueGetRequest.setBalancerDecisionsRequest(request);
NamedQueueGetResponse namedQueueGetResponse =
namedQueueRecorder.getNamedQueueRecords(namedQueueGetRequest);
List<RecentLogs.BalancerDecision> balancerDecisions =
namedQueueGetResponse.getBalancerDecisions();
List<RecentLogs.BalancerDecision> balancerDecisions = namedQueueGetResponse != null ?
namedQueueGetResponse.getBalancerDecisions() :
Collections.emptyList();
return MasterProtos.BalancerDecisionsResponse.newBuilder()
.addAllBalancerDecision(balancerDecisions).build();
}
@ -3098,8 +3099,9 @@ public class MasterRpcServices extends RSRpcServices implements
namedQueueGetRequest.setBalancerRejectionsRequest(request);
NamedQueueGetResponse namedQueueGetResponse =
namedQueueRecorder.getNamedQueueRecords(namedQueueGetRequest);
List<RecentLogs.BalancerRejection> balancerRejections =
namedQueueGetResponse.getBalancerRejections();
List<RecentLogs.BalancerRejection> balancerRejections = namedQueueGetResponse != null ?
namedQueueGetResponse.getBalancerRejections() :
Collections.emptyList();
return MasterProtos.BalancerRejectionsResponse.newBuilder()
.addAllBalancerRejection(balancerRejections).build();
}