Class TextBatchTaskSummaryWriter
- All Implemented Interfaces:
Closeable, AutoCloseable, BatchTaskSummaryWriter
- Author:
- poirigui
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the writer and write any remaining results.voidwrite(BatchTaskProcessingResult result) Record the result for the grouped summary, and emit it immediately.
-
Constructor Details
-
TextBatchTaskSummaryWriter
-
-
Method Details
-
write
Record the result for the grouped summary, and emit it immediately.🛑 The grouped summary can only be written at
close()— it counts and sections the results, so it cannot exist until they all do. That made this writer the one format whose entire record lived in memory until the end of the run, which was survivable only as long as the JVM always reached the end. It no longer does: the CLI runs with-XX:+ExitOnOutOfMemoryError, and that callsos::exit()— noclose(), no shutdown hook, nothing. A sweep that OOM'd on item 7 of 22 would have lost the record of the six that succeeded, which is worse than the hung JVM the flag was added to prevent.TEXT is the default format (anything without
-batchOutputFile), so this was the default exposure. TSV never had it —TsvBatchTaskSummaryWriterflushes each row as it is printed.The per-result line is the same
formatResult(BatchTaskProcessingResult)the summary uses, so the two agree; the summary still follows at close with the counts and the grouping.- Specified by:
writein interfaceBatchTaskSummaryWriter- Throws:
IOException
-
close
Description copied from interface:BatchTaskSummaryWriterClose the writer and write any remaining results.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBatchTaskSummaryWriter- Specified by:
closein interfaceCloseable- Throws:
IOException
-