@Override
  public void consumeEventFromDisruptor(NamedQueuePayload namedQueuePayload) {
    if (!isBalancerDecisionRecording) {
      return;
    }
    if (!(namedQueuePayload instanceof BalancerDecisionDetails)) {
      LOG.warn(
        "BalancerDecisionQueueService: NamedQueuePayload is not of type BalancerDecisionDetails.");
      return;
    }
    BalancerDecisionDetails balancerDecisionDetails = (BalancerDecisionDetails) namedQueuePayload;
    BalancerDecision balancerDecisionRecords = balancerDecisionDetails.getBalancerDecision();
    List<String> regionPlans = balancerDecisionRecords.getRegionPlans();
    List<List<String>> regionPlansList;
    if (regionPlans.size() > REGION_PLANS_THRESHOLD_PER_BALANCER) {
      regionPlansList = Lists.partition(regionPlans, REGION_PLANS_THRESHOLD_PER_BALANCER);
    } else {
      regionPlansList = Collections.singletonList(regionPlans);
    }
    for (List<String> regionPlansPerBalancer : regionPlansList) {
      RecentLogs.BalancerDecision balancerDecision = RecentLogs.BalancerDecision.newBuilder()
        .setInitTotalCost(balancerDecisionRecords.getInitTotalCost())
        .setInitialFunctionCosts(balancerDecisionRecords.getInitialFunctionCosts())
        .setComputedTotalCost(balancerDecisionRecords.getComputedTotalCost())
        .setFinalFunctionCosts(balancerDecisionRecords.getFinalFunctionCosts())
        .setComputedSteps(balancerDecisionRecords.getComputedSteps())
        .addAllRegionPlans(regionPlansPerBalancer).build();
      balancerDecisionQueue.add(balancerDecision);
    }
  }
In-memory Queue service provider for Balancer Decision events
hbase-server/src/main/java/org/apache/hadoop/hbase/namequeues/impl/BalancerDecisionQueueService.java