Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
package org.apache.iotdb.db.pipe.sink.payload.evolvable.batch;

import org.apache.iotdb.commons.pipe.event.EnrichedEvent;
import org.apache.iotdb.db.pipe.resource.PipeDataNodeResourceManager;
import org.apache.iotdb.db.pipe.resource.memory.PipeMemoryBlock;
import org.apache.iotdb.db.pipe.sink.protocol.thrift.async.IoTDBDataRegionAsyncSink;
import org.apache.iotdb.db.storageengine.dataregion.wal.exception.WALPipeException;
import org.apache.iotdb.pipe.api.event.Event;
Expand All @@ -45,6 +47,7 @@ public abstract class PipeTabletEventBatch implements AutoCloseable {
private long firstEventProcessingTime = Long.MIN_VALUE;

protected long totalBufferSize = 0;
private final PipeMemoryBlock allocatedMemoryBlock;

protected volatile boolean isClosed = false;

Expand All @@ -56,6 +59,8 @@ protected PipeTabletEventBatch(

// limit in buffer size
this.maxBatchSizeInBytes = requestMaxBatchSizeInBytes;
this.allocatedMemoryBlock =
PipeDataNodeResourceManager.memory().forceAllocate(requestMaxBatchSizeInBytes);
if (recordMetric != null) {
this.recordMetric = recordMetric;
} else {
Expand Down Expand Up @@ -142,6 +147,7 @@ public synchronized void close() {

clearEventsReferenceCount(PipeTabletEventBatch.class.getName());
events.clear();
allocatedMemoryBlock.close();
}

/**
Expand Down