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
ARowProcessor
implementation to perform row processing tasks in parallel. TheConcurrentRowProcessor
wraps anotherRowProcessor
, and collects rows read from the input. The actual row processing is performed in by wrappedRowProcessor
in a separate thread.- See Also:
AbstractParser
,RowProcessor
-
-
Constructor Summary
Constructors Constructor Description ConcurrentRowProcessor(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ParsingContext
copyContext(ParsingContext context)
protected ParsingContext
wrapContext(ParsingContext context)
-
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractConcurrentProcessor
getRowCount, isContextCopyingEnabled, processEnded, processStarted, rowProcessed, setContextCopyingEnabled
-
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
-
ConcurrentRowProcessor
public ConcurrentRowProcessor(RowProcessor rowProcessor)
Creates a non-blockingConcurrentRowProcessor
, to perform processing of rows parsed from the input in a separate thread.- Parameters:
rowProcessor
- a regularRowProcessor
implementation which will be executed in a separate thread.
-
ConcurrentRowProcessor
public ConcurrentRowProcessor(RowProcessor rowProcessor, int limit)
Creates a blockingConcurrentRowProcessor
, to perform processing of rows parsed from the input in a separate thread.- Parameters:
rowProcessor
- a regularRowProcessor
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.
-
-
Method Detail
-
copyContext
protected ParsingContext copyContext(ParsingContext context)
- Specified by:
copyContext
in classAbstractConcurrentProcessor<ParsingContext>
-
wrapContext
protected ParsingContext wrapContext(ParsingContext context)
- Specified by:
wrapContext
in classAbstractConcurrentProcessor<ParsingContext>
-
-