public void injectAccountAndContainerForDatasetRequest(RestRequest restRequest) throws RestServiceException {
    accountAndContainerSanityCheck(restRequest);
    if (getHeader(restRequest.getArgs(), Headers.TARGET_ACCOUNT_NAME, false) != null
        || getHeader(restRequest.getArgs(), Headers.TARGET_CONTAINER_NAME, false) != null) {
      ensureRequiredHeadersOrThrow(restRequest, requiredAmbryHeadersForGetOrDeleteWithAccountAndContainerName);
      if (restRequest.getRestMethod().equals(RestMethod.GET)) {
        frontendMetrics.getDatasetWithAccountAndContainerHeaderRate.mark();
      } else {
        frontendMetrics.deleteDatasetWithAccountAndContainerHeaderRate.mark();
      }
      injectAccountAndContainerUsingAccountAndContainerHeaders(restRequest, null);
    } else {
      throw new RestServiceException(
          "Missing either " + Headers.TARGET_ACCOUNT_NAME + " or " + Headers.TARGET_CONTAINER_NAME + " header",
          RestServiceErrorCode.BadRequest);
    }
  }
Injects target {@link Account} and {@link Container} for GET or Delete datset requests. This method also ensures required
the GET or Delete requests that carry both the {@code x-ambry-target-account} and {@code x-ambry-target-container} headers.
@param restRequest The Get {@link RestRequest}.
@throws RestServiceException
ambry-frontend/src/main/java/com/github/ambry/frontend/AccountAndContainerInjector.java