zhuanshenbsj1 commented on code in PR #6590:
URL: https://github.com/apache/paimon/pull/6590#discussion_r2579917308
##########
paimon-format/src/main/java/org/apache/paimon/format/orc/writer/OrcBulkWriter.java:
##########
@@ -38,30 +39,39 @@ public class OrcBulkWriter implements FormatWriter {
private final VectorizedRowBatch rowBatch;
private final PositionOutputStream underlyingStream;
+ private long currentBatchMemoryUsage = 0;
+ private final long memoryLimit;
+
public OrcBulkWriter(
Vectorizer<InternalRow> vectorizer,
Writer writer,
PositionOutputStream underlyingStream,
- int batchSize) {
+ int batchSize,
+ MemorySize memoryLimit) {
this.vectorizer = checkNotNull(vectorizer);
this.writer = checkNotNull(writer);
this.rowBatch = vectorizer.getSchema().createRowBatch(batchSize);
this.underlyingStream = underlyingStream;
+ this.memoryLimit = memoryLimit.getBytes();
}
@Override
public void addElement(InternalRow element) throws IOException {
- vectorizer.vectorize(element, rowBatch);
- if (rowBatch.size == rowBatch.getMaxSize()) {
- flush();
+ synchronized (this) {
Review Comment:
Removed sync.
--
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]