Class JdbcRequestHandler
- java.lang.Object
-
- org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler
-
- All Implemented Interfaces:
ClientListenerRequestHandler,ClientTxSupport
public class JdbcRequestHandler extends Object implements ClientListenerRequestHandler, ClientTxSupport
JDBC request handler.
-
-
Constructor Summary
Constructors Constructor Description JdbcRequestHandler(GridSpinBusyLock busyLock, ClientListenerResponseSender sender, int maxCursors, boolean distributedJoins, boolean enforceJoinOrder, boolean collocated, boolean replicatedOnly, boolean autoCloseCursors, boolean lazy, boolean skipReducerOnUpdate, @Nullable String qryEngine, @Nullable Boolean dataPageScanEnabled, @Nullable Integer updateBatchSize, @Nullable TransactionConcurrency concurrency, @Nullable TransactionIsolation isolation, long timeout, @Nullable String lb, ClientListenerProtocolVersion protocolVer, JdbcConnectionContext connCtx)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RuntimeExceptionendTxException(IgniteCheckedException cause)ClientListenerResponsehandle(ClientListenerRequest req)Handle request.ClientListenerResponsehandleException(Throwable e, ClientListenerRequest req)Handle exception.booleanisCancellationCommand(int cmdId)Detect whether given command is a cancellation command.booleanisCancellationSupported()Checks whether query cancellation is supported whithin given version of protocal.voidonDisconnect()Called whenever client is disconnected due to correct connection close or due toIOExceptionduring network operations.ClientListenerProtocolVersionprotocolVersion()voidregisterRequest(long reqId, int cmdType)Registers request for futher cancellation if any.RuntimeExceptionstartTxException(Exception cause)RuntimeExceptiontransactionNotFoundException()voidunregisterRequest(long reqId)Try to unregister request.voidwriteHandshake(BinaryWriterExImpl writer)Write successful handshake response.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.odbc.ClientTxSupport
endTxAsync, startClientTransaction
-
-
-
-
Constructor Detail
-
JdbcRequestHandler
public JdbcRequestHandler(GridSpinBusyLock busyLock, ClientListenerResponseSender sender, int maxCursors, boolean distributedJoins, boolean enforceJoinOrder, boolean collocated, boolean replicatedOnly, boolean autoCloseCursors, boolean lazy, boolean skipReducerOnUpdate, @Nullable @Nullable String qryEngine, @Nullable @Nullable Boolean dataPageScanEnabled, @Nullable @Nullable Integer updateBatchSize, @Nullable @Nullable TransactionConcurrency concurrency, @Nullable @Nullable TransactionIsolation isolation, long timeout, @Nullable @Nullable String lb, ClientListenerProtocolVersion protocolVer, JdbcConnectionContext connCtx)
Constructor.- Parameters:
busyLock- Shutdown latch.sender- Results sender.maxCursors- Maximum allowed cursors.distributedJoins- Distributed joins flag.enforceJoinOrder- Enforce join order flag.collocated- Collocated flag.replicatedOnly- Replicated only flag.autoCloseCursors- Flag to automatically close server cursors.lazy- Lazy query execution flag.skipReducerOnUpdate- Skip reducer on update flag.qryEngine- Name of SQL query engine to use.dataPageScanEnabled- Enable scan data page mode.updateBatchSize- Size of internal batch for DML queries.concurrency- Transaction concurrency.isolation- Transaction isolation.timeout- Transaction timeout.lb- Transaction label.protocolVer- Protocol version.connCtx- Jdbc connection context.
-
-
Method Detail
-
handle
public ClientListenerResponse handle(ClientListenerRequest req)
Handle request.- Specified by:
handlein interfaceClientListenerRequestHandler- Parameters:
req- Request.- Returns:
- Response.
-
isCancellationCommand
public boolean isCancellationCommand(int cmdId)
Detect whether given command is a cancellation command.- Specified by:
isCancellationCommandin interfaceClientListenerRequestHandler- Parameters:
cmdId- Command Id- Returns:
- true if given command is cancellation one, false otherwise;
-
registerRequest
public void registerRequest(long reqId, int cmdType)Registers request for futher cancellation if any.- Specified by:
registerRequestin interfaceClientListenerRequestHandler- Parameters:
reqId- Request Id.cmdType- Command Type.
-
unregisterRequest
public void unregisterRequest(long reqId)
Try to unregister request.- Specified by:
unregisterRequestin interfaceClientListenerRequestHandler- Parameters:
reqId- Request Id.
-
handleException
public ClientListenerResponse handleException(Throwable e, ClientListenerRequest req)
Handle exception.- Specified by:
handleExceptionin interfaceClientListenerRequestHandler- Parameters:
e- Exception.req- Request.- Returns:
- Error response.
-
writeHandshake
public void writeHandshake(BinaryWriterExImpl writer)
Write successful handshake response.- Specified by:
writeHandshakein interfaceClientListenerRequestHandler- Parameters:
writer- Binary writer.
-
onDisconnect
public void onDisconnect()
Called whenever client is disconnected due to correct connection close or due toIOExceptionduring network operations.
-
startTxException
public RuntimeException startTxException(Exception cause)
- Specified by:
startTxExceptionin interfaceClientTxSupport- Parameters:
cause- Exception cause.- Returns:
- Protocol specific start transaction exception.
-
transactionNotFoundException
public RuntimeException transactionNotFoundException()
- Specified by:
transactionNotFoundExceptionin interfaceClientTxSupport- Returns:
- Protocol specific transaction not found exception.
-
endTxException
public RuntimeException endTxException(IgniteCheckedException cause)
- Specified by:
endTxExceptionin interfaceClientTxSupport- Parameters:
cause- Exception cause.- Returns:
- Protocol specific end transaction exception.
-
isCancellationSupported
public boolean isCancellationSupported()
Checks whether query cancellation is supported whithin given version of protocal.- Specified by:
isCancellationSupportedin interfaceClientListenerRequestHandler- Returns:
- True if supported, false otherwise.
-
protocolVersion
public ClientListenerProtocolVersion protocolVersion()
- Specified by:
protocolVersionin interfaceClientListenerRequestHandler- Returns:
- Protocol version.
-
-