private Callback<Long> fetchAccountUpdateBodyCallback(RetainingAsyncWritableChannel channel) {
      return buildCallback(frontendMetrics.postAccountsReadRequestMetrics, bytesRead -> {
        ReadableStreamChannel outputChannel;
        if (RestUtils.getRequestPath(restRequest).matchesOperation(ACCOUNTS_CONTAINERS)) {
          logger.debug("Got request for {} with payload", ACCOUNTS_CONTAINERS);
          Pair<Account, Collection<Container>> accountAndUpdatedContainers = updateContainers(channel);
          outputChannel = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(
              AccountCollectionSerde.serializeContainersInJson(accountAndUpdatedContainers.getSecond())));
          restResponseChannel.setHeader(RestUtils.Headers.TARGET_ACCOUNT_ID,
              accountAndUpdatedContainers.getFirst().getId());
        } else {
          updateAccounts(channel);
          outputChannel = new ByteBufferReadableStreamChannel(ByteBuffer.allocate(0));
        }
        restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime());
        restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE);
        restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, outputChannel.getSize());
        finalCallback.onCompletion(outputChannel, null);
      }, uri, logger, finalCallback);
    }
After reading the body of the account update request, call {@link AccountService#updateAccounts}.
@param channel the {@link RetainingAsyncWritableChannel} to read data out of.
@return a {@link Callback} to be used with {@link RestRequest#readInto}.
ambry-frontend/src/main/java/com/github/ambry/frontend/PostAccountsHandler.java