Interface Worker

All Superinterfaces:
com.fishlib.base.log.LogOutputAppendable

public interface Worker
extends com.fishlib.base.log.LogOutputAppendable
Instances of a Worker interface represent Java process running a RemoteQueryProcessor The Java Process could be an Operating System process, a Docker Container or some other controlled process. Workers are created and destroyed by WorkerControl objects.

Worker instances are essentially a Data Object, with getters and setters. The attributes are parameters and settings used by the WorkerControl object that manages the lifecycle of the Worker.

  • Field Details

  • Method Details

    • start

      void start() throws WorkerControlStartException
      Start the Worker.
      Throws:
      WorkerControlStartException - If an error occurs starting the Worker
    • terminate

      void terminate()
      Terminate the Worker.
    • getName

      String getName()
      Returns the name of this Worker.
      Returns:
      the name of this Worker
    • getWorkerId

      String getWorkerId()
      Returns the id of this Worker
      Returns:
      the id of this Worker
    • getProcessInfoId

      String getProcessInfoId()
      Returns the unique id of this Worker process
      Returns:
      the unique id of this Worker process
    • getWorkerNonce

      String getWorkerNonce()
      Returns the nonce for registering this worker process
      Returns:
      the nonce used for registration
    • getClientConnectionPort

      int getClientConnectionPort()
      Returns the clientConnectionPort of this Worker
      Returns:
      the clientConnectionPort of this Worker
    • getUserName

      String getUserName()
      Returns the userName of this Worker
      Returns:
      the userName of this Worker
    • setProcessUserName

      default void setProcessUserName​(String processUserName)
      Sets a system userName which should run this Worker
      Parameters:
      processUserName - the system user that should run this Worker
    • getProcessUserName

      default String getProcessUserName()
      Returns the system userName which should run this Worker
      Returns:
      the system userName which should run this Worker
    • getClientClassDirectory

      File getClientClassDirectory()
      Returns the clientClassDirectory of this Worker
      Returns:
      the clientClassDirectory of this Worker.
    • getRemoteProcessingRequest

      RemoteProcessingRequest getRemoteProcessingRequest()
      Returns the remoteProcessingRequest of this Worker
      Returns:
      the remoteProcessingRequest of this Worker.
    • getHeapSizeMB

      int getHeapSizeMB()
      Returns the heapSizeMB of this Worker
      Returns:
      the heapSizeMB of this Worker.
    • getPort

      int getPort()
      Returns the port of this Worker
      Returns:
      the port of this Worker
    • getClientConnectionAddress

      String getClientConnectionAddress()
      Returns the client connection address this Worker, which could be a hostname, IP, FQDN, service name, endpoint, etc. Clients will connect to the the Worker via ClientConnectionAddress:Port
      Returns:
      the clientConnectionAddress of this Worker
    • setPort

      void setPort​(int port)
      Set the port for this worker
      Parameters:
      port - the port for this worker
    • getPid

      int getPid()
      Returns the pid of this Worker
      Returns:
      the pid of this Worker
    • isFinished

      boolean isFinished()
      Returns the isFinished status of this Worker
      Returns:
      the isFinished status of this Worker
    • getCompiledClassDirectory

      File getCompiledClassDirectory()
      Returns the compiledClassDirectory of this Worker
      Returns:
      the compiledClassDirectory of this Worker
    • getArtifactDirectory

      File getArtifactDirectory()
      Returns the artifactDirectory of this Worker
      Returns:
      the artifactDirectory of this Worker
    • getUserContext

      com.fishlib.auth.UserContext getUserContext()
      Returns the userContext of this Worker
      Returns:
      the userContext of this Worker
    • getCancelledTimeNS

      long getCancelledTimeNS()
      Returns the cancelledTimeNS of this Worker
      Returns:
      the cancelledTimeNS of this Worker
    • setCancelledTimeNS

      void setCancelledTimeNS​(long cancelledTimeNS)
      Set the cancelledTimeNS for this worker
      Parameters:
      cancelledTimeNS - the port for this worker
    • isTerminateRequestSent

      boolean isTerminateRequestSent()
      Returns the isTerminateRequestSent status of this Worker
      Returns:
      the isTerminateRequestSent status of this Worker
    • setTerminateRequestSent

      void setTerminateRequestSent​(boolean terminateRequestSent)
      Set the terminateRequestSent for this worker
      Parameters:
      terminateRequestSent - status for this worker
    • isJvmDestroySent

      boolean isJvmDestroySent()
      Returns the isJvmDestroySent status of this Worker
      Returns:
      the isJvmDestroySent status of this Worker
    • setJvmDestroySent

      void setJvmDestroySent​(boolean jvmDestroySent)
      Sets the jvmDestroySent status of this Worker
      Parameters:
      jvmDestroySent - status of this Worker
    • getProcessEventLogLogger

      ProcessEventLogFormat2Logger getProcessEventLogLogger()
      Returns the processEventLogLogger of this Worker
      Returns:
      the processEventLogLogger of this Worker
    • getDispatcherHostName

      String getDispatcherHostName()
      Returns the dispatcherHostName of this Worker
      Returns:
      the dispatcherHostName of this Worker
    • getDispatcherNameForDiscovery

      String getDispatcherNameForDiscovery()
      Returns the name of this dispatcher used by etcd for discovery
      Returns:
      the discovery name for this dispatcher
    • getWebsocketPort

      int getWebsocketPort()
      Returns the port that this worker is listening on for incoming websocket connections
      Returns:
      the port that this worker is listening on for incoming websocket connections
    • getLatestErrorMessages

      List<String> getLatestErrorMessages()
      Returns the last few lines captured from the worker's syserr.
      Returns:
      the last few lines from the worker's syserr
    • getTimeToLiveExpiration

      long getTimeToLiveExpiration()
      Return the worker's TTL expiration (in millis since the epoch).
      Returns:
      the maximum time that the worker has renewed it's TTL
    • setTimeToLive

      void setTimeToLive​(long ttl)
      Set the time to live (in millis since the epoch).
    • getLastPostedStatus

      String getLastPostedStatus()
      Returns the last posted status for this Worker; Note it can be null if no status posted yet.
      Returns:
      the last posted status for this Worker
    • setLastPostedStatus

      void setLastPostedStatus​(String lastPostedStatus)
      Set the last posted status for this Worker