1
0

[HUDI-1994] Release the new records iterator for append handle #close (#3058)

This commit is contained in:
Danny Chan
2021-06-10 19:09:23 +08:00
committed by GitHub
parent e0108e972e
commit 125415a8b8
2 changed files with 3 additions and 0 deletions

View File

@@ -386,6 +386,7 @@ public class HoodieAppendHandle<T extends HoodieRecordPayload, I, K, O> extends
try {
// flush any remaining records to disk
appendDataAndDeleteBlocks(header);
recordItr = null;
if (writer != null) {
writer.close();

View File

@@ -532,6 +532,7 @@ public class StreamWriteFunction<K, I, O>
}
bucket.preWrite(records);
final List<WriteStatus> writeStatus = new ArrayList<>(writeFunction.apply(records, instant));
records.clear();
final BatchWriteSuccessEvent event = BatchWriteSuccessEvent.builder()
.taskID(taskID)
.instantTime(instant) // the write instant may shift but the event still use the currentInstant.
@@ -564,6 +565,7 @@ public class StreamWriteFunction<K, I, O>
}
bucket.preWrite(records);
writeStatus.addAll(writeFunction.apply(records, currentInstant));
records.clear();
bucket.reset();
}
});