errose28 commented on code in PR #10536:
URL: https://github.com/apache/ozone/pull/10536#discussion_r3454314249
##########
hadoop-hdds/client/dev-support/run-block-output-stream-write-benchmark.sh:
##########
Review Comment:
In this PR the benchmark is a shell script but in #10546 it is a java class.
We should be consistent with how we create benchmarks and where we put them.
##########
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:
Why should it be configurable at all? The purpose of the benchmarks is to
produce evidence so we can make a conclusive decision.
--
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]