Class BatchedColumnProcessor
- java.lang.Object
-
- com.univocity.parsers.common.processor.core.AbstractBatchedColumnProcessor<ParsingContext>
-
- com.univocity.parsers.common.processor.BatchedColumnProcessor
-
- All Implemented Interfaces:
BatchedColumnReader<java.lang.String>
,ColumnReader<java.lang.String>
,Processor<ParsingContext>
,RowProcessor
public abstract class BatchedColumnProcessor extends AbstractBatchedColumnProcessor<ParsingContext> implements RowProcessor
ARowProcessor
implementation that stores values of columns in batches. Use this implementation in favor ofColumnProcessor
when processing large inputs to avoid running out of memory. Values parsed in each row will be split into columns of Strings. Each column has its own list of values.During the execution of the process, the
AbstractBatchedColumnProcessor.batchProcessed(int)
method will be invoked after a given number of rows has been processed.The user can access the lists with values parsed for all columns using the methods
AbstractBatchedColumnProcessor.getColumnValuesAsList()
,AbstractBatchedColumnProcessor.getColumnValuesAsMapOfIndexes()
andAbstractBatchedColumnProcessor.getColumnValuesAsMapOfNames()
.After
AbstractBatchedColumnProcessor.batchProcessed(int)
is invoked, all values will be discarded and the next batch of column values will be accumulated. This process will repeat until there's no more rows in the input.- See Also:
AbstractParser
,RowProcessor
,AbstractBatchedColumnProcessor
-
-
Constructor Summary
Constructors Constructor Description BatchedColumnProcessor(int rowsPerBatch)
Constructs a batched column processor configured to invoke theAbstractBatchedColumnProcessor.batchesProcessed
method after a given number of rows has been processed.
-
Method Summary
-
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractBatchedColumnProcessor
batchProcessed, getBatchesProcessed, getColumn, getColumn, getColumnValuesAsList, getColumnValuesAsMapOfIndexes, getColumnValuesAsMapOfNames, getHeaders, getRowsPerBatch, processEnded, processStarted, putColumnValuesInMapOfIndexes, putColumnValuesInMapOfNames, rowProcessed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.univocity.parsers.common.processor.RowProcessor
processEnded, processStarted, rowProcessed
-
-
-
-
Constructor Detail
-
BatchedColumnProcessor
public BatchedColumnProcessor(int rowsPerBatch)
Constructs a batched column processor configured to invoke theAbstractBatchedColumnProcessor.batchesProcessed
method after a given number of rows has been processed.- Parameters:
rowsPerBatch
- the number of rows to process in each batch.
-
-