Class BulkLoadProcessor
- java.lang.Object
-
- org.apache.ignite.internal.processors.bulkload.BulkLoadProcessor
-
- All Implemented Interfaces:
AutoCloseable
public class BulkLoadProcessor extends Object implements AutoCloseable
Bulk load (COPY) command processor used on server to keep various context data and process portions of input received from the client side.
-
-
Constructor Summary
Constructors Constructor Description BulkLoadProcessor(BulkLoadParser inputParser, IgniteClosureX<List<?>,IgniteBiTuple<?,?>> dataConverter, BulkLoadCacheWriter outputStreamer, RunningQueryManager runningQryMgr, long qryId, Tracing tracing)Creates bulk load processor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Aborts processing and closes the underlying objects (IgniteDataStreamer).voidonError(Exception failReason)Is called to notify processor, that bulk load execution, this processor is performing, failed with specified exception.BulkLoadCacheWriteroutputStreamer()Returns the streamer that puts actual key/value into the cache.voidprocessBatch(byte[] batchData, boolean isLastBatch)Processes the incoming batch and writes data to the cache by calling the data converter and output streamer.
-
-
-
Constructor Detail
-
BulkLoadProcessor
public BulkLoadProcessor(BulkLoadParser inputParser, IgniteClosureX<List<?>,IgniteBiTuple<?,?>> dataConverter, BulkLoadCacheWriter outputStreamer, RunningQueryManager runningQryMgr, long qryId, Tracing tracing)
Creates bulk load processor.- Parameters:
inputParser- Parser of the input bytes.dataConverter- Converter, which transforms the list of strings parsed from the input stream to the key+value entry to add to the cache.outputStreamer- Streamer that puts actual key/value into the cache.runningQryMgr- Running query manager.qryId- Running query id.tracing- Tracing processor.
-
-
Method Detail
-
outputStreamer
public BulkLoadCacheWriter outputStreamer()
Returns the streamer that puts actual key/value into the cache.- Returns:
- Streamer that puts actual key/value into the cache.
-
processBatch
public void processBatch(byte[] batchData, boolean isLastBatch) throws IgniteCheckedExceptionProcesses the incoming batch and writes data to the cache by calling the data converter and output streamer.- Parameters:
batchData- Data from the current batch.isLastBatch- true if this is the last batch.- Throws:
IgniteIllegalStateException- when called afterclose().IgniteCheckedException
-
onError
public void onError(Exception failReason)
Is called to notify processor, that bulk load execution, this processor is performing, failed with specified exception.- Parameters:
failReason- why current load failed.
-
close
public void close() throws ExceptionAborts processing and closes the underlying objects (IgniteDataStreamer).- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-