Class JdbcBulkLoadBatchRequest
- java.lang.Object
-
- org.apache.ignite.internal.processors.odbc.ClientListenerRequestNoId
-
- org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequest
-
- org.apache.ignite.internal.processors.odbc.jdbc.JdbcBulkLoadBatchRequest
-
- All Implemented Interfaces:
ClientListenerRequest,JdbcRawBinarylizable
public class JdbcBulkLoadBatchRequest extends JdbcRequest
A JDBC request that sends a batch of a file to the server. Used when handlingSqlBulkLoadCommandcommand.
-
-
Field Summary
Fields Modifier and Type Field Description static intCMD_CONTINUENext batch comes in this request and there are more batches.static intCMD_FINISHED_EOFThis is the final batch of the file and everything went well on the client side.static intCMD_FINISHED_ERRORThis is the final batch from the client and there was an error on the client side, so terminate with error on the server side as well.static intCMD_UNKNOWNA sentinel to indicate thatcmdfield was not initialized.-
Fields inherited from class org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequest
BATCH_EXEC, BINARY_TYPE_GET, BINARY_TYPE_NAME_GET, BINARY_TYPE_NAME_PUT, BINARY_TYPE_PUT, CACHE_PARTITIONS, META_COLUMNS, META_INDEXES, META_PARAMS, META_PRIMARY_KEYS, META_SCHEMAS, META_TABLES, QRY_EXEC, QRY_META, TX_END, TX_SET_PARAMS
-
Fields inherited from interface org.apache.ignite.internal.processors.odbc.ClientListenerRequest
HANDSHAKE
-
-
Constructor Summary
Constructors Constructor Description JdbcBulkLoadBatchRequest()Creates the request with uninitialized parameters.JdbcBulkLoadBatchRequest(long cursorId, int batchIdx, int cmd)Creates the request with specified parameters and zero-length data.JdbcBulkLoadBatchRequest(long cursorId, int batchIdx, int cmd, @org.jetbrains.annotations.NotNull byte[] data)Creates the request with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longbatchIdx()Returns the batch index.intcmd()Returns the command (see CMD_xxx constants for details).longcursorId()Returns the original cursor ID.@org.jetbrains.annotations.NotNull byte[]data()Returns the data.voidreadBinary(BinaryReaderExImpl reader, JdbcProtocolContext protoCtx)Reads fields from provided reader.StringtoString()voidwriteBinary(BinaryWriterExImpl writer, JdbcProtocolContext protoCtx)Writes fields to provided writer.-
Methods inherited from class org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequest
readRequest, readRequestId, readType, requestId, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.odbc.ClientListenerRequest
beforeStartupRequest
-
-
-
-
Field Detail
-
CMD_UNKNOWN
public static final int CMD_UNKNOWN
A sentinel to indicate thatcmdfield was not initialized.- See Also:
- Constant Field Values
-
CMD_CONTINUE
public static final int CMD_CONTINUE
Next batch comes in this request and there are more batches.- See Also:
- Constant Field Values
-
CMD_FINISHED_ERROR
public static final int CMD_FINISHED_ERROR
This is the final batch from the client and there was an error on the client side, so terminate with error on the server side as well.- See Also:
- Constant Field Values
-
CMD_FINISHED_EOF
public static final int CMD_FINISHED_EOF
This is the final batch of the file and everything went well on the client side. Server may complete the request.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JdbcBulkLoadBatchRequest
public JdbcBulkLoadBatchRequest()
Creates the request with uninitialized parameters.
-
JdbcBulkLoadBatchRequest
public JdbcBulkLoadBatchRequest(long cursorId, int batchIdx, int cmd)Creates the request with specified parameters and zero-length data. Typically used withCMD_FINISHED_ERRORandCMD_FINISHED_EOF.- Parameters:
cursorId- The cursor ID from theJdbcBulkLoadAckResult.batchIdx- Index of the current batch starting with 0.cmd- The command (CMD_CONTINUE,CMD_FINISHED_EOF, orCMD_FINISHED_ERROR).
-
JdbcBulkLoadBatchRequest
public JdbcBulkLoadBatchRequest(long cursorId, int batchIdx, int cmd, @NotNull @org.jetbrains.annotations.NotNull byte[] data)Creates the request with the specified parameters.- Parameters:
cursorId- The cursor ID from theJdbcBulkLoadAckResult.batchIdx- Index of the current batch starting with 0.cmd- The command (CMD_CONTINUE,CMD_FINISHED_EOF, orCMD_FINISHED_ERROR).data- The data block (zero length is acceptable).
-
-
Method Detail
-
cursorId
public long cursorId()
Returns the original cursor ID.- Returns:
- The original cursor ID.
-
batchIdx
public long batchIdx()
Returns the batch index.- Returns:
- The batch index.
-
cmd
public int cmd()
Returns the command (see CMD_xxx constants for details).- Returns:
- The command.
-
data
@NotNull public @org.jetbrains.annotations.NotNull byte[] data()
Returns the data.- Returns:
- data if data was not supplied
-
writeBinary
public void writeBinary(BinaryWriterExImpl writer, JdbcProtocolContext protoCtx) throws BinaryObjectException
Writes fields to provided writer.- Specified by:
writeBinaryin interfaceJdbcRawBinarylizable- Overrides:
writeBinaryin classJdbcRequest- Parameters:
writer- Binary object writer.protoCtx- JDBC protocol context.- Throws:
BinaryObjectException- In case of error.
-
readBinary
public void readBinary(BinaryReaderExImpl reader, JdbcProtocolContext protoCtx) throws BinaryObjectException
Reads fields from provided reader.- Specified by:
readBinaryin interfaceJdbcRawBinarylizable- Overrides:
readBinaryin classJdbcRequest- Parameters:
reader- Binary object reader.protoCtx- JDBC protocol context.- Throws:
BinaryObjectException- In case of error.
-
toString
public String toString()
- Overrides:
toStringin classJdbcRequest
-
-