private Callback<Void> recursiveCallback(List<DatasetVersionRecord> datasetVersionRecordList, int idx, String accountName,
        String containerName, String datasetName) {
      if (idx == datasetVersionRecordList.size()) {
        return buildCallback(frontendMetrics.deleteBlobSecurityProcessResponseMetrics, securityCheckResult -> {
          accountService.deleteDataset(accountName, containerName, datasetName);
          restResponseChannel.setStatus(ResponseStatus.Accepted);
          restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime());
          restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0);
          finalCallback.onCompletion(null, null);
        }, uri, LOGGER, finalCallback);
      }
      Callback<Void> nextCallBack =
          recursiveCallback(datasetVersionRecordList, idx + 1, accountName, containerName, datasetName);
      DatasetVersionRecord record = datasetVersionRecordList.get(idx);
      return buildCallback(frontendMetrics.deleteBlobSecurityProcessResponseMetrics, securityCheckResult -> {
        reconstructRestRequest(restRequest, record, accountName, containerName);
        deleteBlobHandler.handle(restRequest, restResponseChannel, nextCallBack);
      }, uri, LOGGER, finalCallback);
    }
@param datasetVersionRecordList the list of the {@link DatasetVersionRecord}
@param idx the index of the datasetVersionRecordList
@param accountName the name of the account.
@param containerName the name of the container.
@param datasetName the name of the dataset.
@return the chained {@link Callback} which will delete each dataset version and delete dataset for final step.
ambry-frontend/src/main/java/com/github/ambry/frontend/DeleteDatasetHandler.java