Class QueryProcessorConnectionImpl
java.lang.Object
com.illumon.iris.db.tables.remotequery.QueryProcessorConnectionImpl
- All Implemented Interfaces:
com.fishlib.dataobjects.HashCommandConstants,RemoteQueryCommandConstants,QueryProcessorConnection,io.deephaven.enterprise.comm.api.CommandHandler,io.deephaven.enterprise.comm.BaseCommandConstants
public class QueryProcessorConnectionImpl
extends Object
implements RemoteQueryCommandConstants, io.deephaven.enterprise.comm.api.CommandHandler, QueryProcessorConnection
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface com.illumon.iris.db.tables.remotequery.QueryProcessorConnection
QueryProcessorConnection.AsynchronousErrorHandler, QueryProcessorConnection.AsyncQueryResultHandler<RETURN_TYPE>, QueryProcessorConnection.DisconnectHandler, QueryProcessorConnection.QueryFuture<RETURN_TYPE>, QueryProcessorConnection.QueryHandle, QueryProcessorConnection.QueryProcessorConnectionCommandHandler -
Field Summary
Fields inherited from interface io.deephaven.enterprise.comm.BaseCommandConstants
PING, PONG, REGISTER_QUEUE_LISTENER, RESPONSEFields inherited from interface com.fishlib.dataobjects.HashCommandConstants
HASHTABLE_CLEAR, HASHTABLE_GET_ALL_ENTRIES, HASHTABLE_GET_KEYS, HASHTABLE_PUT, HASHTABLE_PUTALL, HASHTABLE_REMOVE, HASHTABLE_REMOVEALL, HASHTABLE_SUBSCRIBE, HASHTABLE_UNSUBSCRIBEFields inherited from interface com.illumon.iris.db.RemoteQueryCommandConstants
CANCEL_REMOTE_QUERY, CURRENT_HEAP_UPDATE, GET_TABLE_PARTITION_ID, LOG_BUFFER_RECORD, LOG_BUFFER_SUBSCRIPTION, MAXIMUM_HEAP_REQUEST, PROGRESS_UPDATE, REGISTER, REMOTE_QUERY_CONCURRENT, REMOTE_QUERY_DISPATCHER_ADD_JOB, REMOTE_QUERY_DISPATCHER_ADMIN_COMMAND, REMOTE_QUERY_DISPATCHER_CANCEL_JOB, REMOTE_QUERY_DISPATCHER_INFO_FOR_JOB, REMOTE_QUERY_DISPATCHER_PUSH_CLASSES, REMOTE_QUERY_DISPATCHER_THREAD_DUMP, REMOTE_QUERY_FATAL_ERROR, REMOTE_QUERY_GET_SCOPE_VAR, REMOTE_QUERY_METHOD_CALL, REMOTE_QUERY_PREEMPTIVE_TABLE_DELTA, REMOTE_QUERY_PREEMPTIVE_TABLE_SNAPSHOT, REMOTE_QUERY_PREEMPTIVE_TABLE_SUBSCRIPTION, REMOTE_QUERY_PROCESSOR_TERMINATE, REMOTE_QUERY_RELEASE_REFERENCE, REMOTE_QUERY_SERIAL, REMOTE_QUERY_TABLE_ERROR, REMOTE_TABLE_HANDLE_CREATE, REMOTE_TABLE_HANDLE_UPDATE, REMOTE_TABLE_MAP_KEY_ADDITION, REMOTE_TABLE_MAP_RELEASE, RTLM_CREATE_LOGGER, RTLM_DELETE_TABLE, SERVER_INFO_REQUEST, SUBSCRIBE_USAGE_UPDATES -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a command handler to the list of handlers that may service unknown commands.static QueryProcessorConnectionestablishSecondaryConnection(com.fishlib.io.logger.Logger log, AuthToken authToken, String processorName, String processInfoId, String processorHost, int processorPort, int websocketPort, String envoyPrefix, long expirationDeadlineMS, QueryProcessorConnection.DisconnectHandler disconnectHandler, io.deephaven.enterprise.comm.ConnectionMonitor.Params connectionMonitorParams, boolean combineWorkerConnectionStats, TokenFactoryFactory tokenAuthenticationManager) static QueryProcessorConnectionestablishSecondaryConnection(com.fishlib.io.logger.Logger log, AuthToken authToken, String processorName, String processInfoId, String processorHost, int processorPort, long expirationDeadlineMS, QueryProcessorConnection.DisconnectHandler disconnectHandler, io.deephaven.enterprise.comm.ConnectionMonitor.Params connectionMonitorParams) Delegate toestablishSecondaryConnection(Logger, AuthToken, String, String, String, int, int, String, long, DisconnectHandler, ConnectionMonitor.Params, boolean, TokenFactoryFactory)with combineWorkerConnectionStats=false, the default authentication client manager, and "unknown" values for web socket connection.static QueryProcessorConnectionestablishSecondaryConnection(com.fishlib.io.logger.Logger log, AuthToken authToken, String processorName, String processInfoId, String processorHost, int processorPort, long expirationDeadlineMS, QueryProcessorConnection.DisconnectHandler disconnectHandler, io.deephaven.enterprise.comm.ConnectionMonitor.Params connectionMonitorParams, boolean combineWorkerConnectionStats, TokenFactoryFactory tokenAuthenticationManager) Delegate toestablishSecondaryConnection(Logger, AuthToken, String, String, String, int, int, String, long, DisconnectHandler, ConnectionMonitor.Params, boolean, TokenFactoryFactory)with "unknown" values for web socket connection.static QueryProcessorConnectionestablishSecondaryConnection(com.fishlib.io.logger.Logger log, AuthToken authToken, String processorName, String processInfoId, String processorHost, int processorPort, long expirationDeadlineMS, QueryProcessorConnection.DisconnectHandler disconnectHandler, io.deephaven.enterprise.comm.ConnectionMonitor.Params connectionMonitorParams, TokenFactoryFactory tokenAuthenticationManager) Delegate toestablishSecondaryConnection(Logger, AuthToken, String, String, String, int, int, String, long, DisconnectHandler, ConnectionMonitor.Params, boolean, TokenFactoryFactory)with combineWorkerConnectionStats=false, and "unknown" values for web socket connection.<TYPE> TYPEexecuteQuery(byte[] remoteQueryInstanceBytes, boolean concurrent) Execute the given query bytes synchronously and return the result.<TYPE> TYPEexecuteQuery(RemoteQuery<TYPE> remoteQuery, boolean concurrent) Execute the given query synchronously and return the result.<TYPE> QueryProcessorConnection.QueryFuture<TYPE>executeQueryAsync(byte[] remoteQueryInstanceBytes, boolean concurrent) Submit a query asynchronously.executeQueryAsync(byte[] remoteQueryInstanceBytes, boolean concurrent, QueryProcessorConnection.AsyncQueryResultHandler<TYPE> handler) Submit a query asynchronously.<TYPE> QueryProcessorConnection.QueryFuture<TYPE>executeQueryAsync(RemoteQuery<TYPE> remoteQuery, boolean concurrent) Submit a query asynchronously.executeQueryAsync(RemoteQuery<TYPE> remoteQuery, boolean concurrent, QueryProcessorConnection.AsyncQueryResultHandler<TYPE> handler) Submit a query asynchronously.intintvoidhandleClientDeath(io.deephaven.enterprise.comm.api.ClientEntry client) voidhandleCommand(io.deephaven.enterprise.comm.api.ClientEntry client, com.fishlib.base.Command comm) Object[]invokeRemoteTableMethod(int handleId, Method method, Object[] args) Support for RemoteTableHandleManager's remote table method invocations.invokeRemoteTableMethodConcurrent(int handleId, Method method, Object[] args) Support for RemoteTableHandleManager's remoteAsyncMethodtable method invocations.booleanvoidregisterTableErrorHandler(QueryProcessorConnection.AsynchronousErrorHandler asynchronousErrorHandler) voidrelease()Disconnects from the query processor.voidreleaseRemoteTableHandle(Integer handleId) Support for RemoteTableHandleManager's remote table garbage collection.voidreleaseRemoteTableMapHandle(Integer handleId) Support for RemoteTableHandleManager's remote table garbage collection.voidremoveCommandHandler(QueryProcessorConnection.QueryProcessorConnectionCommandHandler commandHandler) Removes a command handler from the lsit of handlers that may service unknown commands.voidsendCommandNoResponse(com.fishlib.base.Command command) Send a single commmand, expecting no response.voidsubscribeToLogBuffer(com.fishlib.io.logger.LogBufferRecordListener listener) booleansubscribeToPreemptiveUpdates(int tableId, BitSet columnsToSubscribe, boolean isViewPort) voidunsubscribeFromLogBuffer(com.fishlib.io.logger.LogBufferRecordListener listener) booleanunsubscribeFromPreemptiveUpdates(int tableId) updatePreemptiveSubscriptionColumnsAsync(int tableId, BitSet newColumns) updateViewportAndColumnsAsync(int tableId, Index newViewPort, BitSet newColumns) updateViewportAsync(int tableId, Index newViewPort) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.tables.remotequery.QueryProcessorConnection
executeQuery, executeQuery
-
Method Details
-
establishSecondaryConnection
public static QueryProcessorConnection establishSecondaryConnection(@NotNull com.fishlib.io.logger.Logger log, @Nullable AuthToken authToken, @NotNull String processorName, @NotNull String processInfoId, @NotNull String processorHost, int processorPort, long expirationDeadlineMS, @Nullable QueryProcessorConnection.DisconnectHandler disconnectHandler, @Nullable io.deephaven.enterprise.comm.ConnectionMonitor.Params connectionMonitorParams) throws IOException Delegate toestablishSecondaryConnection(Logger, AuthToken, String, String, String, int, int, String, long, DisconnectHandler, ConnectionMonitor.Params, boolean, TokenFactoryFactory)with combineWorkerConnectionStats=false, the default authentication client manager, and "unknown" values for web socket connection.- Throws:
IOException
-
establishSecondaryConnection
public static QueryProcessorConnection establishSecondaryConnection(@NotNull com.fishlib.io.logger.Logger log, @Nullable AuthToken authToken, @NotNull String processorName, @NotNull String processInfoId, @NotNull String processorHost, int processorPort, long expirationDeadlineMS, @Nullable QueryProcessorConnection.DisconnectHandler disconnectHandler, @Nullable io.deephaven.enterprise.comm.ConnectionMonitor.Params connectionMonitorParams, @NotNull TokenFactoryFactory tokenAuthenticationManager) throws IOException Delegate toestablishSecondaryConnection(Logger, AuthToken, String, String, String, int, int, String, long, DisconnectHandler, ConnectionMonitor.Params, boolean, TokenFactoryFactory)with combineWorkerConnectionStats=false, and "unknown" values for web socket connection.- Throws:
IOException
-
establishSecondaryConnection
public static QueryProcessorConnection establishSecondaryConnection(@NotNull com.fishlib.io.logger.Logger log, @Nullable AuthToken authToken, @NotNull String processorName, @NotNull String processInfoId, @NotNull String processorHost, int processorPort, long expirationDeadlineMS, @Nullable QueryProcessorConnection.DisconnectHandler disconnectHandler, @Nullable io.deephaven.enterprise.comm.ConnectionMonitor.Params connectionMonitorParams, boolean combineWorkerConnectionStats, @NotNull TokenFactoryFactory tokenAuthenticationManager) throws IOException Delegate toestablishSecondaryConnection(Logger, AuthToken, String, String, String, int, int, String, long, DisconnectHandler, ConnectionMonitor.Params, boolean, TokenFactoryFactory)with "unknown" values for web socket connection.- Throws:
IOException
-
establishSecondaryConnection
public static QueryProcessorConnection establishSecondaryConnection(@NotNull com.fishlib.io.logger.Logger log, @Nullable AuthToken authToken, @NotNull String processorName, @NotNull String processInfoId, @NotNull String processorHost, int processorPort, int websocketPort, String envoyPrefix, long expirationDeadlineMS, @Nullable QueryProcessorConnection.DisconnectHandler disconnectHandler, @Nullable io.deephaven.enterprise.comm.ConnectionMonitor.Params connectionMonitorParams, boolean combineWorkerConnectionStats, @NotNull TokenFactoryFactory tokenAuthenticationManager) throws IOException - Throws:
IOException
-
getDispatcherConnection
- Specified by:
getDispatcherConnectionin interfaceQueryProcessorConnection
-
getProcessorName
- Specified by:
getProcessorNamein interfaceQueryProcessorConnection- Returns:
- The name of the RemoteQueryProcessor's process, and its client-connection CommServer. ("RemoteQueryDispatcher_worker-" + #) Note: RemoteQueryDispatcher code refers to this String as the workerName.
-
getProcessorHost
- Specified by:
getProcessorHostin interfaceQueryProcessorConnection
-
getProcessorPort
public int getProcessorPort()- Specified by:
getProcessorPortin interfaceQueryProcessorConnection
-
getWebsocketPort
public int getWebsocketPort()- Specified by:
getWebsocketPortin interfaceQueryProcessorConnection
-
getEnvoyPrefix
- Specified by:
getEnvoyPrefixin interfaceQueryProcessorConnection
-
getWorkerName
- Specified by:
getWorkerNamein interfaceQueryProcessorConnection- Returns:
- A shorter, more display-friendly version of the RemoteQueryProcessor's name. ("worker_" + #) Note: RemoteQueryDispatcher code refers to this String as the workerId.
-
getProcessInfoId
- Specified by:
getProcessInfoIdin interfaceQueryProcessorConnection- Returns:
- A unique identifier assigned to the RemoteQueryProcessor (worker)
-
subscribeToPreemptiveUpdates
public boolean subscribeToPreemptiveUpdates(int tableId, BitSet columnsToSubscribe, boolean isViewPort) - Specified by:
subscribeToPreemptiveUpdatesin interfaceQueryProcessorConnection
-
unsubscribeFromPreemptiveUpdates
public boolean unsubscribeFromPreemptiveUpdates(int tableId) - Specified by:
unsubscribeFromPreemptiveUpdatesin interfaceQueryProcessorConnection
-
updatePreemptiveSubscriptionColumnsAsync
- Specified by:
updatePreemptiveSubscriptionColumnsAsyncin interfaceQueryProcessorConnection
-
updateViewportAndColumnsAsync
public Future<Boolean> updateViewportAndColumnsAsync(int tableId, Index newViewPort, BitSet newColumns) - Specified by:
updateViewportAndColumnsAsyncin interfaceQueryProcessorConnection
-
updateViewportAsync
- Specified by:
updateViewportAsyncin interfaceQueryProcessorConnection
-
subscribeToLogBuffer
public void subscribeToLogBuffer(@NotNull com.fishlib.io.logger.LogBufferRecordListener listener) throws IOException - Specified by:
subscribeToLogBufferin interfaceQueryProcessorConnection- Throws:
IOException
-
unsubscribeFromLogBuffer
public void unsubscribeFromLogBuffer(@NotNull com.fishlib.io.logger.LogBufferRecordListener listener) throws IOException - Specified by:
unsubscribeFromLogBufferin interfaceQueryProcessorConnection- Throws:
IOException
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceQueryProcessorConnection- Returns:
- The internal CommClient's connection status.
-
release
Disconnects from the query processor. Subsequent method invocations will fail due to disconnection.- Specified by:
releasein interfaceQueryProcessorConnection- Throws:
IOException- if an error occurs communicating with the server
-
getTableManager
- Specified by:
getTableManagerin interfaceQueryProcessorConnection
-
getTableMapManager
- Specified by:
getTableMapManagerin interfaceQueryProcessorConnection
-
getRemoteDatabase
- Specified by:
getRemoteDatabasein interfaceQueryProcessorConnection
-
registerTableErrorHandler
public void registerTableErrorHandler(QueryProcessorConnection.AsynchronousErrorHandler asynchronousErrorHandler) - Specified by:
registerTableErrorHandlerin interfaceQueryProcessorConnection
-
handleCommand
public void handleCommand(io.deephaven.enterprise.comm.api.ClientEntry client, com.fishlib.base.Command comm) - Specified by:
handleCommandin interfaceio.deephaven.enterprise.comm.api.CommandHandler
-
addCommandHandler
public void addCommandHandler(QueryProcessorConnection.QueryProcessorConnectionCommandHandler commandHandler) Description copied from interface:QueryProcessorConnectionAdds a command handler to the list of handlers that may service unknown commands. The QueryProcessorConnection does not hold a reference to the command handler; so the user must ensure reachability of the commandHandler.- Specified by:
addCommandHandlerin interfaceQueryProcessorConnection- Parameters:
commandHandler- the command handler to add.
-
removeCommandHandler
public void removeCommandHandler(QueryProcessorConnection.QueryProcessorConnectionCommandHandler commandHandler) Description copied from interface:QueryProcessorConnectionRemoves a command handler from the lsit of handlers that may service unknown commands.- Specified by:
removeCommandHandlerin interfaceQueryProcessorConnection- Parameters:
commandHandler- the command handler to remove
-
handleClientDeath
public void handleClientDeath(io.deephaven.enterprise.comm.api.ClientEntry client) - Specified by:
handleClientDeathin interfaceio.deephaven.enterprise.comm.api.CommandHandler
-
executeQuery
public <TYPE> TYPE executeQuery(RemoteQuery<TYPE> remoteQuery, boolean concurrent) throws IOException Execute the given query synchronously and return the result. This may convert the RemoteQuery into a byte stream and callQueryProcessorConnection.executeQuery(byte[], boolean)
This method is divorced from any logic for pushing classes to the server-side. Use getDispatcherConnection().pushClientClasses(), if necessary.- Specified by:
executeQueryin interfaceQueryProcessorConnection- Type Parameters:
TYPE- the return type of the remote query- Parameters:
remoteQuery- the queryconcurrent- if true, permit the query to proceed concurrently with data refresh processing- Returns:
- query result
- Throws:
IOException- if an error occurs communicating with the server
-
executeQuery
public <TYPE> TYPE executeQuery(byte[] remoteQueryInstanceBytes, boolean concurrent) Execute the given query bytes synchronously and return the result. This method is for "advanced" usage only, if you already have a remote query instance in byte array form.- Specified by:
executeQueryin interfaceQueryProcessorConnection- Type Parameters:
TYPE- the return type of the remote query- Parameters:
remoteQueryInstanceBytes- the queryconcurrent- if true, permit the query to proceed concurrently with data refresh processing- Returns:
- query result
-
executeQueryAsync
public <TYPE> QueryProcessorConnection.QueryHandle executeQueryAsync(RemoteQuery<TYPE> remoteQuery, boolean concurrent, QueryProcessorConnection.AsyncQueryResultHandler<TYPE> handler) throws IOException Submit a query asynchronously. This may convert the RemoteQuery into a byte stream and callQueryProcessorConnection.executeQueryAsync(byte[], boolean, AsyncQueryResultHandler)Query progress will be reported via the AsyncQueryResultHandler.- Specified by:
executeQueryAsyncin interfaceQueryProcessorConnection- Type Parameters:
TYPE- the return type of the remote query- Parameters:
remoteQuery- the queryconcurrent- if true, permit the query to proceed concurrently with data refresh processinghandler- asynchronous result handler- Returns:
- a QueryHandle for the async query
- Throws:
IOException- if an error occurs communicating with the server
-
executeQueryAsync
public <TYPE> QueryProcessorConnection.QueryFuture<TYPE> executeQueryAsync(RemoteQuery<TYPE> remoteQuery, boolean concurrent) throws IOException Submit a query asynchronously. This may convert the RemoteQuery into a byte stream and callQueryProcessorConnection.executeQueryAsync(byte[], boolean)Returns a query handle from which the results can be retrieved when results are ready- Specified by:
executeQueryAsyncin interfaceQueryProcessorConnection- Type Parameters:
TYPE- the return type of the remote query- Parameters:
remoteQuery- the queryconcurrent- if true, permit the query to proceed concurrently with data refresh processing- Returns:
- a QueryFuture for the async query
- Throws:
IOException- if an error occurs communicating with the server
-
executeQueryAsync
public <TYPE> QueryProcessorConnection.QueryFuture<TYPE> executeQueryAsync(byte[] remoteQueryInstanceBytes, boolean concurrent) Submit a query asynchronously. Returns a query handle from which the results can be retrieved when results are ready This method is for "advanced" usage only, if you already have a remote query instance in byte array form.- Specified by:
executeQueryAsyncin interfaceQueryProcessorConnection- Type Parameters:
TYPE- the return type of the remote query- Parameters:
remoteQueryInstanceBytes- the queryconcurrent- if true, permit the query to proceed concurrently with data refresh processing- Returns:
- a QueryFuture for the async query
-
executeQueryAsync
public <TYPE> QueryProcessorConnection.QueryHandle executeQueryAsync(byte[] remoteQueryInstanceBytes, boolean concurrent, QueryProcessorConnection.AsyncQueryResultHandler<TYPE> handler) Submit a query asynchronously. Query progress will be reported via the AsyncQueryResultHandler. This method is for "advanced" usage only, if you already have a remote query instance in byte array form.- Specified by:
executeQueryAsyncin interfaceQueryProcessorConnection- Type Parameters:
TYPE- the return type of the remote query- Parameters:
remoteQueryInstanceBytes- the queryconcurrent- if true, permit the query to proceed concurrently with data refresh processinghandler- asynchronous result handler- Returns:
- a QueryHandle for the async query
-
releaseRemoteTableHandle
Support for RemoteTableHandleManager's remote table garbage collection.- Specified by:
releaseRemoteTableHandlein interfaceQueryProcessorConnection- Parameters:
handleId- the handle to release
-
invokeRemoteTableMethod
Support for RemoteTableHandleManager's remote table method invocations.- Specified by:
invokeRemoteTableMethodin interfaceQueryProcessorConnection- Parameters:
handleId- the handle to invoke a method onmethod- the Table method to invokeargs- the arguments to the method- Returns:
- the return value of the remotely executed method
-
invokeRemoteTableMethodConcurrent
public Object invokeRemoteTableMethodConcurrent(int handleId, @NotNull Method method, Object[] args) Support for RemoteTableHandleManager's remoteAsyncMethodtable method invocations.- Specified by:
invokeRemoteTableMethodConcurrentin interfaceQueryProcessorConnection- Parameters:
handleId- The handle IDmethod- The methodargs- The method's arguments- Returns:
- THe method's result
-
releaseRemoteTableMapHandle
Support for RemoteTableHandleManager's remote table garbage collection.- Specified by:
releaseRemoteTableMapHandlein interfaceQueryProcessorConnection- Parameters:
handleId- the handle to release
-
sendCommandNoResponse
Description copied from interface:QueryProcessorConnectionSend a single commmand, expecting no response.- Specified by:
sendCommandNoResponsein interfaceQueryProcessorConnection- Parameters:
command- The command to send.- Throws:
IOException- If a problem occurs sending the command.
-