Package com.ocient.jdbc
Class XGConnection
java.lang.Object
com.ocient.jdbc.XGConnection
- All Implemented Interfaces:
AutoCloseable,Connection,Wrapper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic enumstatic enumstatic enumstatic enumstatic classRepresents an addressable endpoint for a network interfacestatic classRepresents a server with multiple network interfacesstatic interfaceA response handler for wire messages.protected static classstatic enumstatic classHandles the entire XGConnection lifecycle.static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected static final Stringprotected Stringprotected intprotected Stringstatic final Stringstatic final Map<String, SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf>>> protected booleanprotected Stringprotected DurationCounterprotected Stringprotected Optional<XGConnection.RemoteEndpoint> protected static booleanprotected OptionalIntstatic final Stringstatic final Pathprotected booleanprotected Stringprotected intprotected CaselessPropertiesprotected Stringprotected Stringprotected XGResultSetprotected List<XGConnection.RemoteNode> protected Stringprotected Stringprotected XGConnection.Sessionstatic final Stringprotected com.ocient.jdbc.XGConnection.Session.Stateprotected XGConnection.Tlsprotected final Stringprotected Stringstatic final Pathprotected ArrayList<SQLWarning> Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidaddTimeout(TimerTask task, long timeout) Schedules the task to run after the specified delayvoidvoidvoidclose()voidcommit()voidconnect()booleancreateArrayOf(String arg0, Object[] arg1) createOktaNativeSSOToken(ClientWireProtocol.OpenIDAuthenticator authenticator, Properties properties) createStatement(int arg0, int arg1) createStatement(int arg0, int arg1, int arg2) createStruct(String arg0, Object[] arg1) protected static <Response,ResponseBuilder extends GeneratedMessageV3.Builder<?>>
ResponsedeserializeProto(ResponseBuilder builder, io.netty.buffer.ByteBuf wireMessage) Deserializes a protobuf message from a ByteBuf.Fetches allClientWireProtocol.Authenticatorsprotected CompletionStage<CompletableFutures.SQLResult<Void>> Asynchronously fetches the version of the server.voidforceExternal(boolean force) forceExternalAsync(boolean force) forkConnection(XGConnectionInfo.Hint hint, boolean hint_bypassLoadBalancerOnHandshakeOnly) Forks a new XGConnection based on the current connection, with optional hints for connection type.forkConnectionAsync(XGConnectionInfo.Hint hint, boolean hint_bypassLoadBalancerOnHandshakeOnly) booleangetClientInfo(String arg0) getDB()intgetInfo()protected List<XGConnection.RemoteNode> protected Optional<XGConnection.RemoteEndpoint> intintintprotected Stream<XGConnection.RemoteEndpoint> protected longintprotected SimplexTransport<io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf> getURL()getUser()protected CompletionStage<CompletableFutures.SQLResult<Void>> initTransport(String ip, int port) protected CompletionStage<CompletableFutures.SQLResult<Void>> booleanisClosed()booleanbooleanisValid(int arg0) protected booleanbooleanisWrapperFor(Class<?> iface) Leases a connection to the database specified byinfo.prepareCall(String arg0) prepareCall(String arg0, int arg1, int arg2) prepareCall(String arg0, int arg1, int arg2, int arg3) prepareStatement(String arg0) prepareStatement(String arg0, int arg1) prepareStatement(String arg0, int[] arg1) prepareStatement(String arg0, int arg1, int arg2) prepareStatement(String arg0, int arg1, int arg2, int arg3) prepareStatement(String arg0, String[] arg1) protected voidPurges all canceled tasks from the timer.readOktaNativeSSOToken(Path tokenFilePath) reconnect(boolean shouldRequestVersion) voidDeprecated.voidreleaseSavepoint(Savepoint arg0) protected CompletionStage<CompletableFutures.SQLResult<Void>> reset(boolean forceParameterRefresh, boolean clearWarnings) static PathresolveOktaNativeSSOTokenFilePath(Properties properties) voidrollback()voidprotected CompletionStage<CompletableFutures.SQLResult<Void>> Sends a heartbeat message to test the connection with the server asynchronously.CompletionStage<CompletableFutures.SQLResult<com.ocient.jdbc.XGConnection.Session.State>> CompletionStage<CompletableFutures.SQLResult<com.ocient.jdbc.XGConnection.Session.State>> sendRefreshToken(com.ocient.jdbc.XGConnection.Session.State oldState) protected <Response> CompletionStage<CompletableFutures.SQLResult<Response>> sendRequest(ClientWireProtocol.Request request, XGConnection.ResponseHandler<Response> responseHandler, Predicate<SQLWarning> warningHandler, XGConnection.ConfirmationSupplier<Response> confirmationSupplier) Sends a request message to the remote server and waits for a response.protected CompletionStage<CompletableFutures.SQLResult<Void>> Sends a request message to the remote server byt does not wait for a response.sendRequestWithStandardResponse(ClientWireProtocol.Request request, Predicate<SQLWarning> warningHandler) Sends a request message to the remote server and waits for a standard confirmation response.voidsetAutoCommit(boolean arg0) voidsetCatalog(String arg0) voidsetClientInfo(String arg0, String arg1) voidsetClientInfo(Properties arg0) booleanvoidsetHoldability(int arg0) intsetMaxRows(Integer maxRows, boolean reset) setMaxRowsHardLimit(Integer maxRows, boolean reset) setMaxTempDisk(Integer maxTempDisk, boolean reset) setMaxTime(Integer maxTime, boolean reset) setMemoryTracing(boolean memoryTracing, boolean reset) static voidsetMetrics(boolean enabled) voidsetNetworkTimeout(Executor executor, int milliseconds) setParallelism(Integer parallelism, boolean reset) setPriority(Double priority, boolean reset) setPriorityAdjustFactor(Double priorityAdjustFactor, boolean reset) setPriorityAdjustTime(Integer priorityAdjustTime, boolean reset) voidsetReadOnly(boolean arg0) setSavepoint(String arg0) voidsetSchemaAsync(String schema) voidsetServerVersion(String version) setServiceClassName(String serviceClassName, boolean reset) voidsetTimeout(int seconds) voidsetTransactionIsolation(int arg0) voidsetTypeMap(Map<String, Class<?>> arg0) protected com.ibm.asyncutil.iteration.AsyncIterator<SimplexTransport.StreamCtx<TransportResult<io.netty.buffer.ByteBuf>>> stream(com.ibm.asyncutil.iteration.AsyncIterator<SimplexTransport.StreamCtx<ClientWireProtocol.Request>> requests, int queueDepth) Exposes a streaming interface that allows the consumer to apply backpressure.static XGConnectionTEST_createConnection(XGConnectionInfo info, Map<String, SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf>>> transportFactories) static XGConnectionTEST_createConnection(String user, String pwd, String ip, int portNum, String url, String database, String protocolVersion, XGConnection.Tls tls, CaselessProperties hint_properties, Map<String, SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf>>> transportFactories) toString()<T> Tbooleanstatic voidwriteOktaNativeSSOToken(Path tokenFilePath, OktaAuthenticators.OktaNativeSSOToken token) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Field Details
-
USER_HOME_PATH
-
OKTA_NATIVE_SSO_TOKEN_FILE_NAME
- See Also:
-
OKTA_NATIVE_SSO_TOKEN_FILE_PATH
-
CLIENT_VERSION
-
DEFAULT_SCHEMA_VALUE
- See Also:
-
DEFAULT_TRANSPORT_FACTORIES
public static final Map<String,SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf, DEFAULT_TRANSPORT_FACTORIESio.netty.buffer.ByteBuf>>> -
rs
-
warnings
-
url
-
originalIp
-
connectedIp
-
originalPort
protected int originalPort -
connectedPort
protected int connectedPort -
user
-
fullyQualifiedUsername
-
database
-
client
-
identityProvider
-
protocolVersion
-
serverVersion
-
oneShotForce
protected boolean oneShotForce -
secondaryInterfaces
-
lastConnectedEndpoint
-
networkTimeout
-
tls
-
handshakeDurationCounter
-
sessionID
-
metricsEnabled
protected static volatile boolean metricsEnabled -
pwd
-
session
-
serverSessionId
-
sessionState
protected com.ocient.jdbc.XGConnection.Session.State sessionState -
typeMap
-
properties
-
setSchema
-
maxRows
-
force
protected boolean force
-
-
Method Details
-
getConnectionPropertiesSet
-
isValidTransport
protected boolean isValidTransport() -
refreshSession
-
refreshToken
-
getConnectionPoolGauges
-
getInfo
-
awaitActivation
-
getTransport
protected SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf> getTransport() throws SQLException- Throws:
SQLException
-
getLocalAddress
-
getRemoteAddress
- Throws:
SQLException
-
leaseConnection
public static CompletionStage<CompletableFutures.SQLResult<XGConnection>> leaseConnection(XGConnectionInfo info) Leases a connection to the database specified byinfo.The returned Connection will have had
XGConnection.XGConnectionFactory.activateObject(XGConnectionInfo, PooledObject)called with theinfopassed into this method.IMPORTANT: This is the ONLY way to establish a connection to the database outside of this immediate compilation unit.
FIXME the static method here is a code smell and makes anything that spawns new connections difficult to unit test...
- Parameters:
info- the desired connection details- Returns:
- a
CompletableFutures.SQLResultcontaining anXGConnection
-
forkConnection
public XGConnection forkConnection(XGConnectionInfo.Hint hint, boolean hint_bypassLoadBalancerOnHandshakeOnly) throws SQLException Forks a new XGConnection based on the current connection, with optional hints for connection type.- Parameters:
hint- the hint for the type of connection to forkhint_bypassLoadBalancerOnHandshakeOnly- set to true to disable redirect on connect- Returns:
- a new XGConnection object based on the current connection, with the specified properties
- Throws:
SQLException- if there is an error creating the new connection
-
forkConnectionAsync
public CompletionStage<CompletableFutures.SQLResult<XGConnection>> forkConnectionAsync(XGConnectionInfo.Hint hint, boolean hint_bypassLoadBalancerOnHandshakeOnly) -
TEST_createConnection
public static XGConnection TEST_createConnection(XGConnectionInfo info, Map<String, SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf>>> transportFactories) -
TEST_createConnection
public static XGConnection TEST_createConnection(String user, String pwd, String ip, int portNum, String url, String database, String protocolVersion, XGConnection.Tls tls, CaselessProperties hint_properties, Map<String, SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf>>> transportFactories) -
abort
- Specified by:
abortin interfaceConnection- Throws:
SQLException
-
addTimeout
Schedules the task to run after the specified delay- Parameters:
task- the task to runtimeout- delay in milliseconds
-
setMetrics
public static void setMetrics(boolean enabled) -
clearOneShotForce
public void clearOneShotForce() -
setFatalException
-
getFatalException
-
wasRedirected
public boolean wasRedirected() -
clearWarnings
- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException
-
getDefaultOAuthFlow
-
resolveOktaNativeSSOTokenFilePath
-
readOktaNativeSSOToken
public static Optional<OktaAuthenticators.OktaNativeSSOToken> readOktaNativeSSOToken(Path tokenFilePath) throws SQLFeatureNotSupportedException, org.jline.reader.UserInterruptException, org.jline.reader.EndOfFileException, FileNotFoundException, IOException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, AuthException, ParseException, com.nimbusds.jose.JOSEException - Throws:
SQLFeatureNotSupportedExceptionorg.jline.reader.UserInterruptExceptionorg.jline.reader.EndOfFileExceptionFileNotFoundExceptionIOExceptionInvalidKeyExceptionNoSuchAlgorithmExceptionNoSuchPaddingExceptionIllegalBlockSizeExceptionBadPaddingExceptionAuthExceptionParseExceptioncom.nimbusds.jose.JOSEException
-
createOktaNativeSSOToken
public static OktaAuthenticators.OktaNativeSSOToken createOktaNativeSSOToken(ClientWireProtocol.OpenIDAuthenticator authenticator, Properties properties) throws KeyManagementException, UnsupportedEncodingException, MalformedURLException, NoSuchAlgorithmException, KeyStoreException, AuthException, IOException, SQLException, URISyntaxException -
writeOktaNativeSSOToken
public static void writeOktaNativeSSOToken(Path tokenFilePath, OktaAuthenticators.OktaNativeSSOToken token) throws SQLFeatureNotSupportedException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidKeySpecException, InvalidAlgorithmParameterException, UnsupportedEncodingException, IOException, com.nimbusds.jose.JOSEException -
sendHeartbeat
Sends a heartbeat message to test the connection with the server asynchronously.- Returns:
- a CompletionStage indicating whether the connection test was successful.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Throws:
SQLException
-
closeAsync
-
commit
- Specified by:
commitin interfaceConnection- Throws:
SQLException
-
connect
- Throws:
SQLException
-
initTransport
-
connected
public boolean connected() -
createArrayOf
- Specified by:
createArrayOfin interfaceConnection- Throws:
SQLException
-
createBlob
- Specified by:
createBlobin interfaceConnection- Throws:
SQLException
-
createClob
- Specified by:
createClobin interfaceConnection- Throws:
SQLException
-
createNClob
- Specified by:
createNClobin interfaceConnection- Throws:
SQLException
-
createSQLXML
- Specified by:
createSQLXMLin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStruct
- Specified by:
createStructin interfaceConnection- Throws:
SQLException
-
fetchAuthenticators
public CompletionStage<CompletableFutures.SQLResult<List<ClientWireProtocol.Authenticator>>> fetchAuthenticators()Fetches allClientWireProtocol.Authenticators- Returns:
- Throws:
SQLException
-
fetchServerVersion
Asynchronously fetches the version of the server.- Returns:
- a CompletionStage that completes when the server version is available, or completes exceptionally if an error occurs while fetching the version.
- Throws:
IOException- if an I/O error occurs while sending the request to the server.InterruptedException- if the RPC to the server is interrupted.
-
forceExternal
public void forceExternal(boolean force) -
forceExternalAsync
-
getAutoCommit
- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException
-
getCatalog
- Specified by:
getCatalogin interfaceConnection- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
getFullyQualifiedUsername
-
getDB
-
getProperties
-
getHoldability
- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException
-
getMajorVersion
public int getMajorVersion() -
getMetaData
- Specified by:
getMetaDatain interfaceConnection- Throws:
SQLException
-
getMinorVersion
public int getMinorVersion() -
getNetworkTimeout
- Specified by:
getNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
getSchema
- Specified by:
getSchemain interfaceConnection- Throws:
SQLException
-
getSchemaLocal
-
getServerVersion
-
getTimeoutMillis
protected long getTimeoutMillis() -
getTransactionIsolation
- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getTypeMap
- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException
-
getURL
-
getUser
-
getVersion
-
getWarnings
- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceConnection
-
isReadOnly
- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException
-
isValid
- Specified by:
isValidin interfaceConnection- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
nativeSQL
- Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String arg0, int arg1, int arg2, int arg3) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
purgeTimeoutTasks
protected void purgeTimeoutTasks()Purges all canceled tasks from the timer.Note: You should only call this if you've canceled a timer. This call may create a
Timerobject if one does not already exist -
reconnectOrThrow
- Throws:
SQLException
-
reconnect
-
reconnect
-
getLastConnectedEndpoint
-
getInterfaces
-
getSecondaryInterfaces
-
initTransportAndBeginHandshake
-
redirect
@Deprecated public CompletionStage<CompletableFutures.SQLResult<Void>> redirect(String host, int port, boolean shouldRequestVersion) Deprecated.As of 2.106, callers should close *this* instance and lease a *new* connection to the desired endpoint usingleaseConnection(XGConnectionInfo)or.invalid reference
DriverManager#getConnection- Parameters:
host-port-shouldRequestVersion-- Returns:
-
releaseSavepoint
- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException
-
reset
protected CompletionStage<CompletableFutures.SQLResult<Void>> reset(boolean forceParameterRefresh, boolean clearWarnings) -
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
sendParameterMessage
public CompletionStage<CompletableFutures.SQLResult<Integer>> sendParameterMessage(ClientWireProtocol.SetParameter param) -
setAutoCommit
- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException
-
setCatalog
- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
setParallelism
public CompletionStage<CompletableFutures.SQLResult<Integer>> setParallelism(Integer parallelism, boolean reset) -
setHoldability
- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException
-
setMaxRows
-
setMaxRowsHardLimit
public CompletionStage<CompletableFutures.SQLResult<Integer>> setMaxRowsHardLimit(Integer maxRows, boolean reset) -
setMaxTempDisk
public CompletionStage<CompletableFutures.SQLResult<Integer>> setMaxTempDisk(Integer maxTempDisk, boolean reset) -
setMaxTime
public CompletionStage<CompletableFutures.SQLResult<Integer>> setMaxTime(Integer maxTime, boolean reset) -
setNetworkTimeout
- Specified by:
setNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
setPriority
public CompletionStage<CompletableFutures.SQLResult<Integer>> setPriority(Double priority, boolean reset) -
setPriorityAdjustFactor
public CompletionStage<CompletableFutures.SQLResult<Integer>> setPriorityAdjustFactor(Double priorityAdjustFactor, boolean reset) -
setServiceClassName
public CompletionStage<CompletableFutures.SQLResult<Integer>> setServiceClassName(String serviceClassName, boolean reset) -
setPriorityAdjustTime
public CompletionStage<CompletableFutures.SQLResult<Integer>> setPriorityAdjustTime(Integer priorityAdjustTime, boolean reset) -
setMemoryTracing
public CompletionStage<CompletableFutures.SQLResult<Integer>> setMemoryTracing(boolean memoryTracing, boolean reset) -
setReadOnly
- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSchemaAsync
-
setSchema
- Specified by:
setSchemain interfaceConnection- Throws:
SQLException
-
setServerVersion
-
setTimeout
- Throws:
SQLException
-
setTransactionIsolation
- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException
-
setTypeMap
- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
sendRefreshSession
public CompletionStage<CompletableFutures.SQLResult<com.ocient.jdbc.XGConnection.Session.State>> sendRefreshSession() -
sendRefreshToken
public CompletionStage<CompletableFutures.SQLResult<com.ocient.jdbc.XGConnection.Session.State>> sendRefreshToken(com.ocient.jdbc.XGConnection.Session.State oldState) -
deserializeProto
protected static <Response,ResponseBuilder extends GeneratedMessageV3.Builder<?>> Response deserializeProto(ResponseBuilder builder, io.netty.buffer.ByteBuf wireMessage) throws IOException Deserializes a protobuf message from a ByteBuf.- Type Parameters:
Response- the response type of the protobuf messageResponseBuilder- the builder type of the protobuf message- Parameters:
builder- a supplier of the builder for the protobuf messagewireMessage- the ByteBuf containing the wire-encoded protobuf message- Returns:
- the deserialized protobuf message
- Throws:
IOException- if an I/O error occurs while reading the ByteBuf
-
sendRequestWithStandardResponse
protected CompletionStage<CompletableFutures.SQLResult<ClientWireProtocol.ConfirmationResponse>> sendRequestWithStandardResponse(ClientWireProtocol.Request request, Predicate<SQLWarning> warningHandler) Sends a request message to the remote server and waits for a standard confirmation response.- Parameters:
request- the request message to send to the server- Returns:
- a
CompletionStagerepresenting the completion of the request and response
-
sendRequest
protected <Response> CompletionStage<CompletableFutures.SQLResult<Response>> sendRequest(ClientWireProtocol.Request request, XGConnection.ResponseHandler<Response> responseHandler, Predicate<SQLWarning> warningHandler, XGConnection.ConfirmationSupplier<Response> confirmationSupplier) Sends a request message to the remote server and waits for a response. Warnings should be handled via thewarningHAndler.- Type Parameters:
Response- the type of the response message- Parameters:
request- the request message to send to the serverresponseHandler- the response handler used to parse the response messagegetHeader- a function used to extract the confirmation header from the response message- Returns:
- a
CompletionStagerepresenting the completion of the request and response
-
stream
protected com.ibm.asyncutil.iteration.AsyncIterator<SimplexTransport.StreamCtx<TransportResult<io.netty.buffer.ByteBuf>>> stream(com.ibm.asyncutil.iteration.AsyncIterator<SimplexTransport.StreamCtx<ClientWireProtocol.Request>> requests, int queueDepth) Exposes a streaming interface that allows the consumer to apply backpressure. The recipient's recv queue will contain up toqueueDepthrequests at any given time. Completion callbacks for each response are applied by the consumer of the returned iterator. -
sendRequestWithoutResponse
protected CompletionStage<CompletableFutures.SQLResult<Void>> sendRequestWithoutResponse(ClientWireProtocol.Request request) Sends a request message to the remote server byt does not wait for a response.- Parameters:
request- the request message to send to the server- Returns:
- a
CompletionStagerepresenting the completion of the request
-
toString
-
leaseConnection(XGConnectionInfo)orinvalid reference