Interface Worker
- All Superinterfaces:
KeepAliveWorker
,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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the additional allocated memory for this worker.Returns the artifactDirectory of this WorkerReturns the auth token for this Workerlong
Returns the cancelledTimeNS of this WorkerReturns the clientClassDirectory of this WorkerReturns the client connection address this Worker, which could be a hostname, IP, FQDN, service name, endpoint, etc.Returns the compiledClassDirectory of this WorkerReturns the dispatcherHostName of this WorkerReturns the name of this dispatcher used by etcd for discoveryint
Returns the heapSizeMB of this WorkerReturns the last few lines captured from the worker's syserr.int
getPid()
Returns the pid of this WorkerReturns the port of this WorkerReturns the processEventLogLogger of this Workerdefault String
Returns the system userName which should run this WorkerList<io.deephaven.enterprise.dispatcher.client.WorkerProtocol>
The protocol that should be used to communicate with this worker.Returns the remoteProcessingRequest of this WorkerReturns the userName of this WorkerAllows K8S workers to specify a hostname for the worker, since each worker will have its own pod name.Returns the id of this Workerboolean
implementsProtocol
(String protocol) Does this worker implement a given protocol?boolean
Returns the isJvmDestroySent status of this Workervoid
If we support it, request a thread dump from the worker.boolean
setCancelledTimeNS
(long cancelledTimeNS) Set the cancelledTimeNS for this workervoid
setJvmDestroySent
(boolean jvmDestroySent) Sets the jvmDestroySent status of this Workerdefault void
setProcessUserName
(String processUserName) Sets a system userName which should run this Workervoid
Set that this worker is registered.boolean
Set the terminateRequestSent for this workervoid
start()
Start theWorker
.void
Terminate theWorker
.Methods inherited from interface com.illumon.iris.db.tables.remotequery.keepalive.KeepAliveWorker
getLastPostedStatus, getName, getProcessInfoId, getTimeToLiveExpiration, getWorkerNonce, isFinished, isRegistered, setLastPostedStatus, setTimeToLive
Methods inherited from interface com.fishlib.base.log.LogOutputAppendable
append
-
Field Details
-
processUser
-
-
Method Details
-
start
Start theWorker
.- Throws:
WorkerControlStartException
- If an error occurs starting the Worker
-
terminate
void terminate()Terminate theWorker
. -
getWorkerId
String getWorkerId()Returns the id of this Worker- Returns:
- the id of this Worker
-
getUserName
String getUserName()Returns the userName of this Worker- Returns:
- the userName of this Worker
-
setProcessUserName
Sets a system userName which should run this Worker- Parameters:
processUserName
- the system user that should run this Worker
-
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.
-
getAdditionalMemoryMB
int getAdditionalMemoryMB()Returns the additional allocated memory for this worker.- Returns:
- the additional memory allocated for this worker, in megabytes
-
setRegistered
void setRegistered()Set that this worker is registered. -
getPort
Returns the port of this Worker- Parameters:
protocol
- the protocol to get a port for- 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
-
getPid
int getPid()Returns the pid of this Worker- Returns:
- the pid 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
-
getAuthToken
AuthToken getAuthToken()Returns the auth token for this Worker -
getCancelledTimeNS
long getCancelledTimeNS()Returns the cancelledTimeNS of this Worker- Returns:
- the cancelledTimeNS of this Worker
-
setCancelledTimeNS
boolean setCancelledTimeNS(long cancelledTimeNS) Set the cancelledTimeNS for this worker- Parameters:
cancelledTimeNS
- the port for this worker- Returns:
- true if the cancellation time was set, false if the worker was already cancelled
-
setTerminateRequestSent
boolean setTerminateRequestSent()Set the terminateRequestSent for this worker- Returns:
- true if the termination request was set, false if the termination request sent field has already been set
-
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
-
getProtocols
List<io.deephaven.enterprise.dispatcher.client.WorkerProtocol> getProtocols()The protocol that should be used to communicate with this worker. Values that are currently defined are "Enterprise", "EnterpriseWebsocket" or "Community", but the dispatcher itself does not care, it just passes it to the client- Returns:
- the protocols that the worker implement
-
implementsProtocol
Does this worker implement a given protocol?- Parameters:
protocol
- the protocol to check this worker for- Returns:
- whether the worker supports the requested protocol
-
getLatestErrorMessages
Returns the last few lines captured from the worker's syserr.- Returns:
- the last few lines from the worker's syserr
-
getWorkerHostname
String getWorkerHostname()Allows K8S workers to specify a hostname for the worker, since each worker will have its own pod name.- Returns:
- The hostname of the worker.
-
requestThreadDump
void requestThreadDump()If we support it, request a thread dump from the worker. Implementing this method is optional.
-