Processor<ParsingContext>
, RowProcessor
public class ConcurrentRowProcessor extends AbstractConcurrentProcessor<ParsingContext> implements RowProcessor
RowProcessor
implementation to perform row processing tasks in parallel. The ConcurrentRowProcessor
wraps another RowProcessor
, and collects rows read from the input.
The actual row processing is performed in by wrapped RowProcessor
in a separate thread.AbstractParser
,
RowProcessor
Constructor | Description |
---|---|
ConcurrentRowProcessor(RowProcessor rowProcessor) |
Creates a non-blocking
ConcurrentRowProcessor , to perform processing of rows parsed from the input in a separate thread. |
ConcurrentRowProcessor(RowProcessor rowProcessor,
int limit) |
Creates a blocking
ConcurrentRowProcessor , to perform processing of rows parsed from the input in a separate thread. |
Modifier and Type | Method | Description |
---|---|---|
protected ParsingContext |
copyContext(ParsingContext context) |
|
protected ParsingContext |
wrapContext(ParsingContext context) |
getRowCount, isContextCopyingEnabled, processEnded, processStarted, rowProcessed, setContextCopyingEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processEnded, processStarted, rowProcessed
public ConcurrentRowProcessor(RowProcessor rowProcessor)
ConcurrentRowProcessor
, to perform processing of rows parsed from the input in a separate thread.rowProcessor
- a regular RowProcessor
implementation which will be executed in a separate thread.public ConcurrentRowProcessor(RowProcessor rowProcessor, int limit)
ConcurrentRowProcessor
, to perform processing of rows parsed from the input in a separate thread.rowProcessor
- a regular RowProcessor
implementation which will be executed in a separate thread.limit
- the limit of rows to be kept in memory before the input parsing process is blocked.protected ParsingContext copyContext(ParsingContext context)
copyContext
in class AbstractConcurrentProcessor<ParsingContext>
protected ParsingContext wrapContext(ParsingContext context)
wrapContext
in class AbstractConcurrentProcessor<ParsingContext>