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