Interface QueryDispatcherConnection.QueryProcessorRequestHandle
- Enclosing interface:
- QueryDispatcherConnection
public static interface QueryDispatcherConnection.QueryProcessorRequestHandle
Single-use query processor request tracking mechanism. Enables cancellation of requests in progress as well
as already-running remote query processors.
-
Method Summary
Modifier and Type Method Description QueryDispatcherConnection.QueryProcessorRequestHandle
sendRequest(RemoteProcessingRequest request, boolean exportQueryScope, List<RemoteQueryClassDefinition> classList, long timeoutMillis, QueryProcessorConnection.DisconnectHandler disconnectHandler, com.fishlib.net.ConnectionMonitor.Params connectionMonitorParams, com.fishlib.auth.WAuthenticationClientManager authenticationClientManager)
Send an asynchronous request for a new query processor.default void
sendRequestCancellation()
Delegate tosendRequestCancellation(boolean, boolean)
with ignoreMissingJob=false and waitForResponse=false.default void
sendRequestCancellation(boolean ignoreMissingJob)
Delegate tosendRequestCancellation(boolean, boolean)
with waitForResponse=false.void
sendRequestCancellation(boolean ignoreMissingJob, boolean waitForResponse)
Send an asynchronous request to initiate cancellation of a previous request for a new query processor, whether that request is currently in progress (triggers removal from the queue) or completed (triggers remote query processor death).QueryProcessorConnection
waitForConnection()
Wait for the completion of a previously sent request, initiate connection to the assigned remote query processor, and return the connection object.
-
Method Details
-
sendRequest
QueryDispatcherConnection.QueryProcessorRequestHandle sendRequest(RemoteProcessingRequest request, boolean exportQueryScope, List<RemoteQueryClassDefinition> classList, long timeoutMillis, @Nullable QueryProcessorConnection.DisconnectHandler disconnectHandler, @Nullable com.fishlib.net.ConnectionMonitor.Params connectionMonitorParams, @NotNull com.fishlib.auth.WAuthenticationClientManager authenticationClientManager) throws RemoteQueryExceptionSend an asynchronous request for a new query processor. May only be invoked once.- Parameters:
request
-exportQueryScope
-classList
-timeoutMillis
-disconnectHandler
-connectionMonitorParams
-- Returns:
- This object, to allow for chained methods.
- Throws:
RemoteQueryException
-
sendRequestCancellation
Delegate tosendRequestCancellation(boolean, boolean)
with ignoreMissingJob=false and waitForResponse=false.- Throws:
RemoteQueryException
- Note: Will prevent future sendRequest() calls from succeeding. Will execute after a concurrent sendRequest() call completes.
-
sendRequestCancellation
Delegate tosendRequestCancellation(boolean, boolean)
with waitForResponse=false.- Parameters:
ignoreMissingJob
- if true, don't return an exception if the job is missing- Throws:
RemoteQueryException
- Note: Will prevent future sendRequest() calls from succeeding. Will execute after a concurrent sendRequest() call completes.
-
sendRequestCancellation
void sendRequestCancellation(boolean ignoreMissingJob, boolean waitForResponse) throws RemoteQueryExceptionSend an asynchronous request to initiate cancellation of a previous request for a new query processor, whether that request is currently in progress (triggers removal from the queue) or completed (triggers remote query processor death).- Parameters:
ignoreMissingJob
- if true, don't return an exception if the job is missingwaitForResponse
- if true, wait for a response from the dispatcher before returning- Throws:
RemoteQueryException
- Note: Will prevent future sendRequest() calls from succeeding. Will execute after a concurrent sendRequest() call completes.
-
waitForConnection
Wait for the completion of a previously sent request, initiate connection to the assigned remote query processor, and return the connection object.- Returns:
- The resulting QueryProcessorConnection. Note: May be invoked anytime after sendRequest has completed, from any thread.
- Throws:
RemoteQueryException
- if an error occurs waiting for the worker connection
-