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

pack-priv Interface BatchedColumnReader<T>

extends ColumnReader<T>
Known Direct Implementers
com.univocity.parsers.common.processor.core.AbstractBatchedColumnProcessor, com.univocity.parsers.common.processor.core.AbstractBatchedObjectColumnProcessor
Type Parameters
<T>
the type of the data stored by the columns.

A common interface for Processors that collect the values parsed from each column in a row and store values of columns in batches.

Use implementations of this interface implementation in favor of ColumnReader when processing large inputs to avoid running out of memory.

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
AbstractBatchedColumnProcessor, AbstractBatchedObjectColumnProcessor, Processor

Method Summary

Modifier and TypeMethod and Description
public void
batchProcessed(int
the number of rows processed in the current batch. This corresponds to the number of elements of each list of each column.
rowsInThisBatch
)

Callback to the user, where the lists with values parsed for all columns can be accessed using the methods getColumnValuesAsList(), getColumnValuesAsMapOfIndexes() and getColumnValuesAsMapOfNames().

public int

Returns:

the number of batches already processed
getBatchesProcessed
()

Returns the number of batches already processed

public int

Returns:

the number of rows per batch
getRowsPerBatch
()

Returns the number of rows processed in each batch

Inherited from com.univocity.parsers.common.processor.core.ColumnReader:
getColumngetColumngetColumnValuesAsListgetColumnValuesAsMapOfIndexesgetColumnValuesAsMapOfNamesgetHeadersputColumnValuesInMapOfIndexesputColumnValuesInMapOfNames

Method Detail

batchProcessedback to summary
public void batchProcessed(int rowsInThisBatch)

Callback to the user, where the lists with values parsed for all columns can be accessed using the methods getColumnValuesAsList(), getColumnValuesAsMapOfIndexes() and getColumnValuesAsMapOfNames().

Parameters
rowsInThisBatch:int

the number of rows processed in the current batch. This corresponds to the number of elements of each list of each column.

getBatchesProcessedback to summary
public int getBatchesProcessed()

Returns the number of batches already processed

Returns:int

the number of batches already processed

getRowsPerBatchback to summary
public int getRowsPerBatch()

Returns the number of rows processed in each batch

Returns:int

the number of rows per batch