private List<DruidCoordinatorHelper> makeIndexingServiceHelpers( final AtomicReference<DatasourceWhitelist> whitelistRef) { List<DruidCoordinatorHelper> helpers = Lists.newArrayList(); helpers.add(new DruidCoordinatorSegmentInfoLoader(DruidCoordinator.this)); if (config.isConvertSegments()) { helpers.add(new DruidCoordinatorVersionConverter(indexingServiceClient, whitelistRef)); } if (config.isMergeSegments()) { helpers.add(new DruidCoordinatorSegmentMerger(indexingServiceClient, whitelistRef)); helpers.add( new DruidCoordinatorHelper() { @Override public DruidCoordinatorRuntimeParams run(DruidCoordinatorRuntimeParams params) { CoordinatorStats stats = params.getCoordinatorStats(); log.info( "Issued merge requests for %s segments", stats.getGlobalStats().get("mergedCount").get()); params .getEmitter() .emit( new ServiceMetricEvent.Builder() .build( "coordinator/merge/count", stats.getGlobalStats().get("mergedCount"))); return params; } }); } return ImmutableList.copyOf(helpers); }