From 0955a7a22ebcdf5d850832eb7ab6f1edc80fa18d Mon Sep 17 00:00:00 2001 From: Viraj Jasani Date: Fri, 14 May 2021 12:54:07 +0530 Subject: [PATCH] HBASE-25884 Return empty records for disabled balancer in-memory queue (#3263) Signed-off-by: stack Signed-off-by: Duo Zhang Signed-off-by: Aman Poonia --- .../apache/hadoop/hbase/master/MasterRpcServices.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index 13dc31efe77..b33d4b8eb5b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -3428,8 +3428,9 @@ public class MasterRpcServices extends RSRpcServices implements namedQueueGetRequest.setBalancerDecisionsRequest(request); NamedQueueGetResponse namedQueueGetResponse = namedQueueRecorder.getNamedQueueRecords(namedQueueGetRequest); - List balancerDecisions = - namedQueueGetResponse.getBalancerDecisions(); + List balancerDecisions = namedQueueGetResponse != null ? + namedQueueGetResponse.getBalancerDecisions() : + Collections.emptyList(); return MasterProtos.BalancerDecisionsResponse.newBuilder() .addAllBalancerDecision(balancerDecisions).build(); } @@ -3446,8 +3447,9 @@ public class MasterRpcServices extends RSRpcServices implements namedQueueGetRequest.setBalancerRejectionsRequest(request); NamedQueueGetResponse namedQueueGetResponse = namedQueueRecorder.getNamedQueueRecords(namedQueueGetRequest); - List balancerRejections = - namedQueueGetResponse.getBalancerRejections(); + List balancerRejections = namedQueueGetResponse != null ? + namedQueueGetResponse.getBalancerRejections() : + Collections.emptyList(); return MasterProtos.BalancerRejectionsResponse.newBuilder() .addAllBalancerRejection(balancerRejections).build(); }