Class DndWorkerKind
java.lang.Object
com.illumon.iris.db.tables.remotequery.DndWorkerKind
- All Implemented Interfaces:
KubernetesWorkerKind,LocalProcessWorkerKind,WorkerKind
public class DndWorkerKind
extends Object
implements WorkerKind, LocalProcessWorkerKind, KubernetesWorkerKind
A worker kind for Community in Enterprise workers (DnD).
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.tables.remotequery.process.LocalProcessWorkerKind
LocalProcessWorkerKind.CommandHelper -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final intstatic final booleanstatic final Stringstatic final intWe must have at least one session connected by default.static final StringIf this is greater than zero, then enforce that we have at least this many sessions connected.static final StringWhat requirements should we install into the specified venv?static final booleanstatic final StringShould we create an ephemeral Python virtual environment?static final Stringstatic final StringShould an InteractiveConsole query delete itself on termination?static final Stringstatic final StringProvides JSON string representing a persistent query's script path loader state for consistency across script loading.static final StringThis provides the persistent query serial number, if we are executing as a persistent query.static final booleanBy default, the worker does not push script session changes.static final StringShould the worker push script session changes to the controller?The set of fields related to Python worker creation.static final Stringstatic final StringSettings for replay queries.static final StringThis selects the language of the script session you are creating as part of the worker.static final booleanstatic final StringShould we freeze the venv requirements to determine the ephemeral venvs starting packages?static final StringWhat is the grace period for session timeouts?static final Stringstatic final StringOptional string value that if available, will execute as a script on worker startup.static final Stringstatic final StringFields inherited from interface com.illumon.iris.db.tables.remotequery.process.kubernetes.KubernetesWorkerKind
ENV_KEY_ARGS, ENV_KEY_ARTIFACT_DEST, ENV_KEY_ARTIFACT_USER, ENV_KEY_AUTHENTICATED_USER, ENV_KEY_CLASSPATH_PREFIX, ENV_KEY_EXTRA_JVM_OPTIONS, ENV_KEY_JAVA_OPTS, ENV_KEY_KUBERNETES_NAMESPACE, ENV_KEY_KUBERNETES_SERVICE_HOST, ENV_KEY_PROC_NAMEFields inherited from interface com.illumon.iris.db.tables.remotequery.WorkerKind
ALLOWED_GROUPS_DEFAULT, ALLOWED_GROUPS_PROPERTY, DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIf the worker should be launched by a site-specific process rather than being launched directly from the start script, then WorkerKind.<worker-type>.commandPrefix can be set to define the start command.createPersistentQueryHandle(com.fishlib.io.logger.Logger log, Object queryHandleContext) Create a PersistentQueryHandle for use by the Controller.intReturn display order for dropdown list in web UI.Return a List of the groups allowed to run this WorkerKind.getClasspathPrefix(Worker worker) Get the default pod template filename for the worker kind.intGet the default worker start timeout for the worker kind, in seconds.Return an optional description of this WorkerKind for use in the UI.getEnvironmentVariables(Worker worker) Provides a map of environment variable names and values to be added to the k8s container.getJvmArgs(Worker worker) Provides a list of JVM args to be added to the java command line.The name of the environment variable that has the jvm args used by the worker process.getQueryWorkerArg(Worker worker) Get a command string that will be used to start the worker.getTitle()Return a string that should be used for drop-down menus in the UI.The worker control type required for a particular request.What protocols does this kind of worker implement?booleanSome customers have custom artifacts per user, which are passed to the Enterprise start script with the -u, -t, and -r options.booleanTrue if temporary dispatcher produced class paths should be included on the command line with -C.booleanTrue if -A "name" should be included on the command line.booleanCheck if this kind is a Community worker kindbooleanAre ephemeral virtual environments the default behavior for this worker?static booleankindHasEphemeralVenv(String workerKindName) Does the provided worker kind (by name) use ephemeral virtual environments by default?booleanDoes this produce a JVM that requires DHE specific JVM argumentsbooleanDoes this produce a JVM that requires JVM like argumentsCreate a helper for generating a new command line.booleanIf true, the query worker args are to be set as the container command.What kind of worker controls could be required for starting these kind of workers?Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.tables.remotequery.WorkerKind
isLegacy
-
Field Details
-
SCRIPT_LANGUAGE_JSON_FIELD
This selects the language of the script session you are creating as part of the worker. The valid values are "groovy" and "python". There is no default.- See Also:
-
PQ_SERIAL_JSON_FIELD
This provides the persistent query serial number, if we are executing as a persistent query.- See Also:
-
PQ_SCRIPT_PATH_LOADER_STATE_JSON_FIELD
Provides JSON string representing a persistent query's script path loader state for consistency across script loading.- See Also:
-
STARTUP_SCRIPT_JSON_FIELD
Optional string value that if available, will execute as a script on worker startup.- See Also:
-
ENFORCE_SESSION_COUNT_FIELD
If this is greater than zero, then enforce that we have at least this many sessions connected.- See Also:
-
SESSION_TIMEOUT_MILLIS_FIELD
What is the grace period for session timeouts?- See Also:
-
INTERACTIVE_CONSOLE_AUTO_DELETE_FIELD
Should an InteractiveConsole query delete itself on termination?- See Also:
-
ENFORCE_SESSION_COUNT_DEFAULT
public static final int ENFORCE_SESSION_COUNT_DEFAULTWe must have at least one session connected by default.- See Also:
-
PUSH_SESSION_CHANGES_TO_CONTROLLER_FIELD
Should the worker push script session changes to the controller?- See Also:
-
REPLAY_SETTINGS_NODE
Settings for replay queries.- See Also:
-
PUSH_SESSION_CHANGES_TO_CONTROLLER_DEFAULT
public static final boolean PUSH_SESSION_CHANGES_TO_CONTROLLER_DEFAULTBy default, the worker does not push script session changes.- See Also:
-
ENABLE_TABLE_REFRESH_FIELD
- See Also:
-
ENABLE_TABLE_REFRESH_DEFAULT
public static final boolean ENABLE_TABLE_REFRESH_DEFAULT- See Also:
-
EPHEMERAL_VENV_FIELD
Should we create an ephemeral Python virtual environment?- See Also:
-
EPHEMERAL_VENV_DEFAULT
public static final boolean EPHEMERAL_VENV_DEFAULT- See Also:
-
SEED_EPHEMERAL_VENV_FIELD
Should we freeze the venv requirements to determine the ephemeral venvs starting packages?- See Also:
-
SEED_EPHEMERAL_VENV_DEFAULT
public static final boolean SEED_EPHEMERAL_VENV_DEFAULT- See Also:
-
EPHEMERAL_REQUIREMENTS_FIELD
What requirements should we install into the specified venv?- See Also:
-
PYTHON_FIELDS
The set of fields related to Python worker creation. -
WORKER_HOSTNAME
- See Also:
-
ADMIN_GROUPS
- See Also:
-
VIEWER_GROUPS
- See Also:
-
PQ_NAME_JSON_FIELD
- See Also:
-
QUERY_WORKER_DND_POD_TEMPLATE_PROPERTY
- See Also:
-
DEFAULT_QUERY_WORKER_DND_POD_TEMPLATE
- See Also:
-
START_DND_K8S_WORKER_TIMEOUT_SECONDS_PROPERTY
- See Also:
-
DEFAULT_START_DND_K8S_WORKER_TIMEOUT_SECONDS
public static final int DEFAULT_START_DND_K8S_WORKER_TIMEOUT_SECONDS- See Also:
-
EPHEMERAL_VENV_PROPERTY_SUFFIX
- See Also:
-
-
Constructor Details
-
DndWorkerKind
-
-
Method Details
-
workerControlTypes
Description copied from interface:WorkerKindWhat kind of worker controls could be required for starting these kind of workers?- Specified by:
workerControlTypesin interfaceWorkerKind- Returns:
- the desired WorkerControlType
-
getWorkerControlTypeForRequest
Description copied from interface:WorkerKindThe worker control type required for a particular request.- Specified by:
getWorkerControlTypeForRequestin interfaceWorkerKind- Parameters:
request- the request that a worker is being created for- Returns:
- the type of worker control for this particular request
-
getDescription
Description copied from interface:WorkerKindReturn an optional description of this WorkerKind for use in the UI.- Specified by:
getDescriptionin interfaceWorkerKind- Returns:
- a description, or null
-
getTitle
Description copied from interface:WorkerKindReturn a string that should be used for drop-down menus in the UI.- Specified by:
getTitlein interfaceWorkerKind- Returns:
- the title of the worker
-
implementedProtocols
Description copied from interface:WorkerKindWhat protocols does this kind of worker implement?- Specified by:
implementedProtocolsin interfaceWorkerKind- Returns:
- a list of protocol names that this worker implements
-
createPersistentQueryHandle
@NotNull public Object createPersistentQueryHandle(@NotNull com.fishlib.io.logger.Logger log, @NotNull Object queryHandleContext) Description copied from interface:WorkerKindCreate a PersistentQueryHandle for use by the Controller. This is necessarily reflexive so implementations must guarantee that the returned object implements the PersistentQueryHandle interface.- Specified by:
createPersistentQueryHandlein interfaceWorkerKind- Parameters:
log- a Log object to use for loggingqueryHandleContext- an arbitrary context object to initialize the handle with.- Returns:
- a new persistent query handle
-
isCommunity
public boolean isCommunity()Description copied from interface:WorkerKindCheck if this kind is a Community worker kind- Specified by:
isCommunityin interfaceWorkerKind- Returns:
- true if the worker kind is Community
-
displayOrder
public int displayOrder()Description copied from interface:WorkerKindReturn display order for dropdown list in web UI. Lower values are displayed first. Enterprise workers use displayOrder 100. Community workers use display order 200 by default, which for Vermilion and later installations is overridden in iris-environment.prop to 50.- Specified by:
displayOrderin interfaceWorkerKind
-
getAllowedGroups
Description copied from interface:WorkerKindReturn a List of the groups allowed to run this WorkerKind.- Specified by:
getAllowedGroupsin interfaceWorkerKind- Returns:
- a List of the groups allowed to run this WorkerKind
-
isEphemeralVenvDefault
public boolean isEphemeralVenvDefault()Description copied from interface:WorkerKindAre ephemeral virtual environments the default behavior for this worker?- Specified by:
isEphemeralVenvDefaultin interfaceWorkerKind
-
newCommandHelper
Description copied from interface:LocalProcessWorkerKindCreate a helper for generating a new command line.- Specified by:
newCommandHelperin interfaceLocalProcessWorkerKind- Returns:
- a new command line helper.
-
needsJvmFlags
public boolean needsJvmFlags()Description copied from interface:LocalProcessWorkerKindDoes this produce a JVM that requires JVM like arguments- Specified by:
needsJvmFlagsin interfaceLocalProcessWorkerKind- Returns:
- true if this kind of worker needs JVM arguments
-
needsDheJvmFlags
public boolean needsDheJvmFlags()Description copied from interface:LocalProcessWorkerKindDoes this produce a JVM that requires DHE specific JVM arguments- Specified by:
needsDheJvmFlagsin interfaceLocalProcessWorkerKind- Returns:
- true if this kind of worker needs DHE specific JVM arguments
-
includeNameArgument
public boolean includeNameArgument()Description copied from interface:LocalProcessWorkerKindTrue if -A "name" should be included on the command line.- Specified by:
includeNameArgumentin interfaceLocalProcessWorkerKind- Returns:
- true if the name argument is included
-
includeExtraClassPaths
public boolean includeExtraClassPaths()Description copied from interface:LocalProcessWorkerKindTrue if temporary dispatcher produced class paths should be included on the command line with -C.- Specified by:
includeExtraClassPathsin interfaceLocalProcessWorkerKind- Returns:
- true if the dispatcher's temporary classpaths should be included
-
includeArtifactArguments
public boolean includeArtifactArguments()Description copied from interface:LocalProcessWorkerKindSome customers have custom artifacts per user, which are passed to the Enterprise start script with the -u, -t, and -r options. True if those options be included in the command.- Specified by:
includeArtifactArgumentsin interfaceLocalProcessWorkerKind- Returns:
- true if -u, -t, and -r options should be included
-
commandPrefix
Description copied from interface:LocalProcessWorkerKindIf the worker should be launched by a site-specific process rather than being launched directly from the start script, then WorkerKind.<worker-type>.commandPrefix can be set to define the start command. For example, this can be used to launch workers that use a Kerberos keytab to run as a user, e.g.:WorkerKind.<worker-type>.commandPrefix=k5start -f /path/to/krb5.keytab -U -- sh -c- Specified by:
commandPrefixin interfaceLocalProcessWorkerKind- Returns:
- List of command and args used to launch a worker, or null if the property is not set.
-
getDefaultPodTemplateFile
Description copied from interface:KubernetesWorkerKindGet the default pod template filename for the worker kind.- Specified by:
getDefaultPodTemplateFilein interfaceKubernetesWorkerKind- Returns:
- filename containing the pod template yaml
-
getDefaultWorkerStartTimeoutSecs
public int getDefaultWorkerStartTimeoutSecs()Description copied from interface:KubernetesWorkerKindGet the default worker start timeout for the worker kind, in seconds.- Specified by:
getDefaultWorkerStartTimeoutSecsin interfaceKubernetesWorkerKind- Returns:
- start timeout value to be configured on the worker pod.
-
getQueryWorkerArg
Description copied from interface:KubernetesWorkerKindGet a command string that will be used to start the worker.- Specified by:
getQueryWorkerArgin interfaceKubernetesWorkerKind- Parameters:
worker- A worker object that will run as a k8s pod.- Returns:
- Worker start command
-
useQueryWorkerArgAsContainerCommand
public boolean useQueryWorkerArgAsContainerCommand()Description copied from interface:KubernetesWorkerKindIf true, the query worker args are to be set as the container command. If false, the query worker args may be set as an environment variable, and a start script configured in the pod template yaml will use that.- Specified by:
useQueryWorkerArgAsContainerCommandin interfaceKubernetesWorkerKind- Returns:
- True if getQueryWorkerArg(Worker w) should be set as the worker container's command array.
-
getClasspathPrefix
- Specified by:
getClasspathPrefixin interfaceKubernetesWorkerKind
-
getJvmArgs
Description copied from interface:KubernetesWorkerKindProvides a list of JVM args to be added to the java command line.- Specified by:
getJvmArgsin interfaceKubernetesWorkerKind- Parameters:
worker- A worker object that will run as a k8s pod.- Returns:
- JVM arg list, e.g. ["-Dkey1=val1", "-Dkey2=val2", "-Xmx4096m"]
-
getJvmArgsEnvVarName
Description copied from interface:KubernetesWorkerKindThe name of the environment variable that has the jvm args used by the worker process.- Specified by:
getJvmArgsEnvVarNamein interfaceKubernetesWorkerKind
-
getEnvironmentVariables
Description copied from interface:KubernetesWorkerKindProvides a map of environment variable names and values to be added to the k8s container.- Specified by:
getEnvironmentVariablesin interfaceKubernetesWorkerKind- Parameters:
worker- A worker object that will run as a k8s pod.- Returns:
- A map of environment variable names and values
-
getJsPluginsPath
-
kindHasEphemeralVenv
Does the provided worker kind (by name) use ephemeral virtual environments by default?- Parameters:
workerKindName- the name of the worker kind- Returns:
- true if this worker kind should use an ephemeral virtual environment by default
-