@Override
  public NamedQueueGetResponse getNamedQueueRecords(NamedQueueGetRequest request) {
    if (!isBalancerDecisionRecording) {
      return null;
    }
    List<RecentLogs.BalancerDecision> balancerDecisions =
      Arrays.stream(balancerDecisionQueue.toArray(new RecentLogs.BalancerDecision[0]))
        .collect(Collectors.toList());
    // latest records should be displayed first, hence reverse order sorting
    Collections.reverse(balancerDecisions);
    int limit = balancerDecisions.size();
    if (request.getBalancerDecisionsRequest().hasLimit()) {
      limit = Math.min(request.getBalancerDecisionsRequest().getLimit(), balancerDecisions.size());
    }
    // filter limit if provided
    balancerDecisions = balancerDecisions.subList(0, limit);
    final NamedQueueGetResponse namedQueueGetResponse = new NamedQueueGetResponse();
    namedQueueGetResponse.setNamedQueueEvent(BalancerDecisionDetails.BALANCER_DECISION_EVENT);
    namedQueueGetResponse.setBalancerDecisions(balancerDecisions);
    return namedQueueGetResponse;
  }
In-memory Queue service provider for Balancer Decision events
hbase-server/src/main/java/org/apache/hadoop/hbase/namequeues/impl/BalancerDecisionQueueService.java