Class ConcurrentRowProcessor
java.lang.Object
com.univocity.parsers.common.processor.core.AbstractConcurrentProcessor<ParsingContext>
com.univocity.parsers.common.processor.ConcurrentRowProcessor
- All Implemented Interfaces:
Processor<ParsingContext>,RowProcessor
public class ConcurrentRowProcessor
extends AbstractConcurrentProcessor<ParsingContext>
implements RowProcessor
A
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.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConcurrentRowProcessor(RowProcessor rowProcessor) Creates a non-blockingConcurrentRowProcessor, to perform processing of rows parsed from the input in a separate thread.ConcurrentRowProcessor(RowProcessor rowProcessor, int limit) Creates a blockingConcurrentRowProcessor, to perform processing of rows parsed from the input in a separate thread. -
Method Summary
Modifier and TypeMethodDescriptionprotected ParsingContextcopyContext(ParsingContext context) protected ParsingContextwrapContext(ParsingContext context) Methods inherited from class com.univocity.parsers.common.processor.core.AbstractConcurrentProcessor
getRowCount, isContextCopyingEnabled, processEnded, processStarted, rowProcessed, setContextCopyingEnabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.univocity.parsers.common.processor.RowProcessor
processEnded, processStarted, rowProcessed
-
Constructor Details
-
ConcurrentRowProcessor
Creates a non-blockingConcurrentRowProcessor, to perform processing of rows parsed from the input in a separate thread.- Parameters:
rowProcessor- a regularRowProcessorimplementation which will be executed in a separate thread.
-
ConcurrentRowProcessor
Creates a blockingConcurrentRowProcessor, to perform processing of rows parsed from the input in a separate thread.- Parameters:
rowProcessor- a regularRowProcessorimplementation 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.
-
-
Method Details
-
copyContext
- Specified by:
copyContextin classAbstractConcurrentProcessor<ParsingContext>
-
wrapContext
- Specified by:
wrapContextin classAbstractConcurrentProcessor<ParsingContext>
-