private <T> void completeConversion(T conversionResult, Exception exception, CompletableFuture<T> completableFuture,
        Callback<T> callback) {
      if (exception == null) {
        completableFuture.complete(conversionResult);
      } else {
        completableFuture.completeExceptionally(exception);
      }
      if (callback != null) {
        long startTime = System.currentTimeMillis();
        callback.onCompletion(conversionResult, exception);
        frontendMetrics.idConversionDownstreamCallbackTimeInMs.update(System.currentTimeMillis() - startTime);
      }
    }
Completes the conversion by setting the future and invoking the callback.
@param conversionResult the conversion result.
@param exception any exception that occurred as a part of the conversion.
@param completableFuture the {@link CompletableFuture} that must be set.
@param callback the {@link Callback} that needs to be invoked. Can be null.
ambry-frontend/src/main/java/com/github/ambry/frontend/AmbryIdConverterFactory.java