3232 * object allocation).</li>
3333 * </ul>
3434 * <p>
35- * The {@link CopyMode} controls what happens with downloaded data in the
36- * response body callback:
35+ * The {@link FFMJavaBenchmarkRunner. CopyMode} controls what happens with
36+ * downloaded data in the response body callback:
3737 * <ul>
38- * <li>{@link CopyMode#NONE} — data is discarded (zero-copy, benchmark
39- * measures pure download throughput with no data processing)</li>
40- * <li>{@link CopyMode#HEAP_COPY} — data is copied into a GC-managed
41- * {@code byte[]} (simulates an application that needs a Java-owned copy)</li>
42- * <li>{@link CopyMode#OFFHEAP_COPY} — data is copied into a pre-allocated
43- * off-heap {@link MemorySegment} (simulates an application that needs an
44- * owned copy but wants to avoid GC pressure)</li>
38+ * <li>{@link FFMJavaBenchmarkRunner.CopyMode#NONE} — data is discarded
39+ * (zero-copy, benchmark measures pure download throughput)</li>
40+ * <li>{@link FFMJavaBenchmarkRunner.CopyMode#HEAP_COPY} — data is copied
41+ * into a GC-managed {@code byte[]}</li>
42+ * <li>{@link FFMJavaBenchmarkRunner.CopyMode#OFFHEAP_COPY} — data is copied
43+ * into a pre-allocated off-heap {@link MemorySegment}</li>
4544 * </ul>
4645 */
4746class FFMJavaTask implements S3MetaRequestResponseHandler {
4847
49- /**
50- * Controls what happens with downloaded data in the response body callback.
51- */
52- enum CopyMode {
53- /** Discard data immediately — zero-copy, no allocation. */
54- NONE ,
55- /** Copy into a GC-managed {@code byte[]} on every callback. */
56- HEAP_COPY ,
57- /** Copy into a pre-allocated off-heap {@link MemorySegment}. */
58- OFFHEAP_COPY ,
59- }
60-
6148 FFMJavaBenchmarkRunner runner ;
6249 int taskI ;
6350 TaskConfig config ;
6451 S3MetaRequest metaRequest ;
6552 CompletableFuture <Void > doneFuture ;
66- final CopyMode copyMode ;
53+ final FFMJavaBenchmarkRunner . CopyMode copyMode ;
6754
6855 /**
6956 * Pre-allocated off-heap buffer for {@link CopyMode#OFFHEAP_COPY}.
@@ -73,15 +60,15 @@ enum CopyMode {
7360 private final MemorySegment offheapCopyBuffer ;
7461 private static final long OFFHEAP_BUFFER_SIZE = 8L * 1024 * 1024 ; // 8 MiB
7562
76- FFMJavaTask (FFMJavaBenchmarkRunner runner , int taskI , CopyMode copyMode ) {
63+ FFMJavaTask (FFMJavaBenchmarkRunner runner , int taskI , FFMJavaBenchmarkRunner . CopyMode copyMode ) {
7764 this .runner = runner ;
7865 this .taskI = taskI ;
7966 this .config = runner .config .tasks .get (taskI );
8067 this .copyMode = copyMode ;
8168 doneFuture = new CompletableFuture <Void >();
8269
8370 // Pre-allocate off-heap buffer if needed
84- if (copyMode == CopyMode .OFFHEAP_COPY ) {
71+ if (copyMode == FFMJavaBenchmarkRunner . CopyMode .OFFHEAP_COPY ) {
8572 offheapCopyBuffer = Arena .ofAuto ().allocate (OFFHEAP_BUFFER_SIZE );
8673 } else {
8774 offheapCopyBuffer = null ;
0 commit comments