public void resolveChunk(Exception exception) {
      if (buffer != null) {
        long bytesWritten = buffer.position() - startPos;
        future.done(bytesWritten, exception);
        if (callback != null) {
          callback.onCompletion(bytesWritten, exception);
        }
      }
    }
Marks a chunk as handled and invokes the callback and future that accompanied this chunk of data. Once a chunk is
resolved, the data inside it is considered void.
@param exception the reason for chunk handling failure.
ambry-test-utils/src/main/java/com/github/ambry/router/ByteBufferAWC.java