org.apache.ignite.internal.processors.bulkload

## 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 and 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
`void` `close()` Aborts processing and closes the underlying objects (`IgniteDataStreamer`).
`void` `onError(Exception failReason)` Is called to notify processor, that bulk load execution, this processor is performing, failed with specified exception.
`BulkLoadCacheWriter` `outputStreamer()` Returns the streamer that puts actual key/value into the cache.
`void` `processBatch(byte[] batchData, boolean isLastBatch)` Processes the incoming batch and writes data to the cache by calling the data converter and output streamer.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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 IgniteCheckedException

Processes 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 after `close()`.
  `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 Exception

Aborts processing and closes the underlying objects (`IgniteDataStreamer`).

Specified by:
  `close` in interface `AutoCloseable`
Throws:
  `Exception`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023