Class CommunityPersistentQueryHandle

java.lang.Object
com.illumon.iris.controller.handle.CommunityPersistentQueryHandle
All Implemented Interfaces:
PersistentQueryHandle

public class CommunityPersistentQueryHandle extends Object
A Handle to a Persistent Query backed by an Enterprise worker.
  • Field Details

  • 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

      protected boolean onDispatcherConnected(@NotNull QueryDispatcherConnection dispatcherConnection)
    • 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 interface PersistentQueryHandle
      Returns:
      the version of the running query
    • getState

      public PersistentQueryState getState()
      Description copied from interface: PersistentQueryHandle
      Get the current state object for the Persistent Query.
      Specified by:
      getState in interface PersistentQueryHandle
      Returns:
      the current state
    • start

      public void start()
      Description copied from interface: PersistentQueryHandle
      Start the worker.
      Specified by:
      start in interface PersistentQueryHandle
    • shutdown

      public void shutdown(String lastAuthenticatedUser, String lastEffectiveUser)
      Description copied from interface: PersistentQueryHandle
      Shutdown the worker, if it is running.
      Specified by:
      shutdown in interface PersistentQueryHandle
      Parameters:
      lastAuthenticatedUser - the authenticating user requesting the shutdown
      lastEffectiveUser - 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

      protected boolean maybeSetTerminalStatus(Supplier<PersistentQueryState.Status> statusSupplier)
    • onError

      protected void onError(@Nullable Throwable t)
    • onFailure

      protected void onFailure(@Nullable Throwable t, boolean awaitDisconnection)
    • onFailure

      protected void onFailure(@Nullable Throwable t, boolean awaitDisconnection, @Nullable String message)
    • publishState

      protected void publishState()
    • getScriptCode

      protected String getScriptCode()