private Callback<Void> securityPostProcessRequestCallback() {
      return buildCallback(metrics.getClusterMapSnapshotSecurityPostProcessRequestMetrics, securityCheckResult -> {
        LOGGER.trace("Getting snapshot of the cluster map");
        long startTime = System.currentTimeMillis();
        try {
          byte[] replicasResponseBytes = clusterMap.getSnapshot().toString().getBytes();
          restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime());
          restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE);
          restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, replicasResponseBytes.length);
          ReadableStreamChannel channel = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(replicasResponseBytes));
          finalCallback.onCompletion(channel, null);
        } finally {
          metrics.getClusterMapSnapshotProcessingTimeInMs.update(System.currentTimeMillis() - startTime);
        }
      }, restRequest.getUri(), LOGGER, finalCallback);
    }
After {@link SecurityService#postProcessRequest} finishes, construct the snapshot of the {@link #clusterMap}.
@return a {@link Callback} to be used with {@link SecurityService#postProcessRequest}.
ambry-frontend/src/main/java/com/github/ambry/frontend/GetClusterMapSnapshotHandler.java