rnblough commented on code in PR #10536:
URL: https://github.com/apache/ozone/pull/10536#discussion_r3461899206


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/ChunkBuffer.java:
##########
@@ -17,18 +17,30 @@
 
 package org.apache.hadoop.ozone.common;
 
+import com.google.common.annotations.VisibleForTesting;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.channels.GatheringByteChannel;
 import java.util.List;
 import java.util.Objects;
+import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.hadoop.hdds.utils.db.CodecBuffer;
 import org.apache.ratis.thirdparty.com.google.protobuf.ByteString;
 import org.apache.ratis.util.UncheckedAutoCloseable;
 
 /** Buffer for a block chunk. */
 public interface ChunkBuffer extends ChunkBufferToByteString, 
UncheckedAutoCloseable {
 
+  /**
+   * When true, {@link #allocate} uses direct ByteBuffers instead of heap 
ByteBuffers.
+   * Set only by {@link BlockOutputStreamWriteBenchmark} to compare allocation 
strategies
+   * within a single benchmark run; must never be modified in production code.
+   */
+  @VisibleForTesting
+  // CHECKSTYLE:OFF VisibilityModifier
+  AtomicBoolean ALLOCATE_DIRECT = new AtomicBoolean(false);
+  // CHECKSTYLE:ON VisibilityModifier

Review Comment:
   I endorse the idea of an ozone-dev style public repo for POC, benchmarks, & 
profiling; it would be particularly great if we could keep reference to the 
benchmark and profiling results themselves for later development. But if the 
second repo is also Apache, does that let us off the GPL hook?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to