@Override
  public void onCompletion(Long result, Exception exception) {
    if (callbackInvoked.compareAndSet(false, true)) {
      bytesWritten = result;
      this.exception = exception;
    } else {
      this.exception = new IllegalStateException("Callback invoked more than once");
    }
  }
Create a write callback.
@param writeId the id to attach to the callback.
ambry-commons/src/test/java/com/github/ambry/commons/ByteBufferAsyncWritableChannelTest.java