Top Description Constructors Methods
com.univocity.parsers.common.processor

public abstract Class BatchedColumnProcessor

extends AbstractBatchedColumnProcessor<ParsingContext>
implements RowProcessor
Class Inheritance
All Implemented Interfaces
com.univocity.parsers.common.processor.RowProcessor, com.univocity.parsers.common.processor.core.Processor
Imports
com.univocity.parsers.common.*, com.univocity.parsers.common.processor.core.*

A RowProcessor implementation that stores values of columns in batches. Use this implementation in favor of ColumnProcessor 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 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 getColumnValuesAsList(), getColumnValuesAsMapOfIndexes() and getColumnValuesAsMapOfNames().

After 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.

Author
Univocity Software Pty Ltd - [email protected]
See Also
AbstractParser, RowProcessor, AbstractBatchedColumnProcessor

Constructor Summary

AccessConstructor and Description
public
BatchedColumnProcessor(int
the number of rows to process in each batch.
rowsPerBatch
)

Constructs a batched column processor configured to invoke the batchesProcessed method after a given number of rows has been processed.

Method Summary

Inherited from com.univocity.parsers.common.processor.core.AbstractBatchedColumnProcessor:
batchProcessedgetBatchesProcessedgetColumngetColumngetColumnValuesAsListgetColumnValuesAsMapOfIndexesgetColumnValuesAsMapOfNamesgetHeadersgetRowsPerBatchprocessEndedprocessStartedputColumnValuesInMapOfIndexesputColumnValuesInMapOfNamesrowProcessed

Constructor Detail

BatchedColumnProcessorback to summary
public BatchedColumnProcessor(int rowsPerBatch)

Constructs a batched column processor configured to invoke the batchesProcessed method after a given number of rows has been processed.

Parameters
rowsPerBatch:int

the number of rows to process in each batch.