Class CommunityPersistentQueryHandle
java.lang.Object
com.illumon.iris.controller.handle.CommunityPersistentQueryHandle
- All Implemented Interfaces:
PersistentQueryHandle
A Handle to a Persistent Query backed by an Enterprise worker.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PersistentQueryConfiguration
protected final ControllerConfigurationType
protected final PersistentQueryDbServerConfig
protected final com.fishlib.net.ConnectionMonitor.Params
protected final PublicPrivateKeyEncryption
protected final ThreadPoolExecutor
protected final ScriptPathLoader
protected final com.fishlib.io.logger.Logger
static final int
protected final PersistentQueryState
-
Constructor Summary
ConstructorsConstructorDescriptionCommunityPersistentQueryHandle
(com.fishlib.io.logger.Logger log, Object queryHandleContext) Create a new Handle for an enterprise worker. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected WorkerHandle
createWorkerHandle
(RemoteProcessingRequest request, QueryDispatcherConnection dispatcherConnection) protected void
ensureShutdown
(boolean awaitDisconnection) protected String
getState()
Get the current state object for the Persistent Query.long
Get the currently running version of the Persistent Query.protected boolean
maybeSetTerminalStatus
(Supplier<PersistentQueryState.Status> statusSupplier) protected boolean
onDispatcherConnected
(QueryDispatcherConnection dispatcherConnection) protected void
protected void
protected void
protected void
protected void
void
Shutdown the worker, if it is running.void
start()
Start the worker.
-
Field Details
-
MAX_INBOUND_MESSAGE_SIZE
public static final int MAX_INBOUND_MESSAGE_SIZE -
log
@NotNull protected final com.fishlib.io.logger.Logger log -
configurationType
-
config
-
loader
-
dbServerConfig
-
state
-
dispatcherConnectionMonitorParams
protected final com.fishlib.net.ConnectionMonitor.Params dispatcherConnectionMonitorParams -
executorService
-
encryption
-
workerRequestHandle
-
-
Constructor Details
-
CommunityPersistentQueryHandle
public CommunityPersistentQueryHandle(@NotNull com.fishlib.io.logger.Logger log, @NotNull Object queryHandleContext) Create a new Handle for an enterprise worker.- Parameters:
log
- the log.queryHandleContext
- A context object containing the required parameters for this object.
-
-
Method Details
-
onStartRequested
protected void onStartRequested() -
onDispatcherConnected
-
createWorkerHandle
protected WorkerHandle createWorkerHandle(RemoteProcessingRequest request, QueryDispatcherConnection dispatcherConnection) -
getVersion
public long getVersion()Description copied from interface:PersistentQueryHandle
Get the currently running version of the Persistent Query.- Specified by:
getVersion
in interfacePersistentQueryHandle
- Returns:
- the version of the running query
-
getState
Description copied from interface:PersistentQueryHandle
Get the current state object for the Persistent Query.- Specified by:
getState
in interfacePersistentQueryHandle
- Returns:
- the current state
-
start
public void start()Description copied from interface:PersistentQueryHandle
Start the worker.- Specified by:
start
in interfacePersistentQueryHandle
-
shutdown
Description copied from interface:PersistentQueryHandle
Shutdown the worker, if it is running.- Specified by:
shutdown
in interfacePersistentQueryHandle
- Parameters:
lastAuthenticatedUser
- the authenticating user requesting the shutdownlastEffectiveUser
- the effective user requesting the shuutdown
-
ensureShutdown
protected void ensureShutdown(boolean awaitDisconnection) - Parameters:
awaitDisconnection
- Used to communicate whether we need to care further about ensuring disconnection, or not. If true, we block until interrupted or until another thread calls ensureShutdown(false). If false, we're asserting that the DB is already disconnected, or that we don't care (because no script was run yet).
-
checkQueryTerminatingOrTerminal
protected boolean checkQueryTerminatingOrTerminal() -
maybeSetTerminalStatus
-
onError
-
onFailure
-
onFailure
-
publishState
protected void publishState() -
getScriptCode
-