@Override
    public Future<String> convert(RestRequest restRequest, String input, BlobProperties blobProperties, Callback<String> callback) {
      final CompletableFuture<String> future = new CompletableFuture<>();
      String convertedId = null;
      Exception exception = null;
      frontendMetrics.idConverterRequestRate.mark();
      long startTimeInMs = System.currentTimeMillis();
      try {
        if (!isOpen) {
          exception = new RestServiceException("IdConverter is closed", RestServiceErrorCode.ServiceUnavailable);
        } else if (restRequest.getRestMethod().equals(RestMethod.POST) && !RestUtils.isS3Request(restRequest)) {
          // Ambry chunk uploads come as POST requests. Sign id if required.
          // TODO [S3] Add ID conversion for S3 POST requests (coming during multipart uploads) as well
          convertedId = "/" + signIdIfRequired(restRequest, input);
        } else {
          CallbackUtils.callCallbackAfter(convertId(input, restRequest, blobProperties),
              (id, e) -> completeConversion(id, e, future, callback));
        }
      } catch (Exception e) {
        exception = e;
      } finally {
        frontendMetrics.idConverterProcessingTimeInMs.update(System.currentTimeMillis() - startTimeInMs);
        if (convertedId != null || exception != null) {
          completeConversion(convertedId, exception, future, callback);
        }
      }
      return future;
    }
{@inheritDoc} On {@link RestMethod#POST}, adds a leading slash to indicate that the ID represents the path of the
resource created. On any other {@link RestMethod}, removes the leading slash in order to convert the path into an
ID that the {@link com.github.ambry.router.Router} will understand.

@param restRequest    {@link RestRequest} representing the request.
@param input          the ID that needs to be converted.
@param blobProperties the {@link BlobInfo} for an uploaded blob. This will be used for named blob PUT requests.
@param callback       the {@link Callback} to invoke once the converted ID is available. Can be null.
@return a {@link Future} that will eventually contain the converted ID.
ambry-frontend/src/main/java/com/github/ambry/frontend/AmbryIdConverterFactory.java