private Callback<Long> fetchDatasetUpdateBodyCallback(RetainingAsyncWritableChannel channel) {
      return buildCallback(frontendMetrics.postDatasetsReadRequestMetrics, bytesRead -> {
        try {
          datasetToUpdate = AccountCollectionSerde.datasetsFromInputStreamInJson(channel.consumeContentAsInputStream());
          if (datasetToUpdate == null) {
            throw new RestServiceException("The dataset is null after deserialize from given InputStream",
                RestServiceErrorCode.BadRequest);
          }
          if (Objects.equals(datasetToUpdate.getRetentionCount(), 0) || Objects.equals(
              datasetToUpdate.getRetentionTimeInSeconds(), 0L)) {
            throw new RestServiceException("The dataset" + datasetToUpdate.getDatasetName()
                + "'s retentionCount or retentionTimeInSeconds should not be 0, " + "retentionCount: "
                + datasetToUpdate.getRetentionCount() + " retentionTime: "
                + datasetToUpdate.getRetentionTimeInSeconds(), RestServiceErrorCode.BadRequest);
          }
          accountAndContainerInjector.injectAccountAndContainerUsingDatasetBody(restRequest, datasetToUpdate);
          // Start the callback chain by performing request security processing.
          securityService.processRequest(restRequest, securityProcessRequestCallback());
        } catch (IOException e) {
          throw new RestServiceException("Bad dataset update request body", e, RestServiceErrorCode.BadRequest);
        }
      }, uri, logger, finalCallback);
    }
After reading the body of the account update request, inject the account and container in request for access check.
@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/PostDatasetsHandler.java