Class GenericCommandWorkerKind
- All Implemented Interfaces:
LocalProcessWorkerKind
,WorkerKind
This class is configured through properties that control the basic command line and provide options to the
WorkerCommandBuilder through overriding methods to LocalProcessWorkerKind
. To add a WorkerKind to the
dispatcher, specify a property of the form WorkerKind.class.<i>name</i>=com.illumon.iris.db.tables.remotequery.GenericCommandWorkerKind
.
The name is used by the dispatcher to select this WorkerKind; and to determine the prefix for other properties.
WorkerKind.<i>name</i>.command
is required; and is the command (and arguments) that form the base of executed
command. Arguments are separated by spaces and may be quoted, it is not possible to pass an empty command line argument (i.e. "").
In addition to the command property; you may specify:
WorkerKind.<i>name</i>.jvm | Is this worker a JVM? If so, the command builder adds appropriate JVM arguments like heap size and property definitions |
WorkerKind.<i>name</i>.includeName | Include a -A argument for the name of the process. |
WorkerKind.<i>name</i>.includeExtraClassPaths | Include temporary class paths generated by the dispatcher. |
WorkerKind.<i>name</i>.includeArtifactArguments | Include -u, -t, and -r arguments for the artifact download script. |
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.tables.remotequery.process.LocalProcessWorkerKind
LocalProcessWorkerKind.CommandHelper
-
Field Summary
Fields 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.int
Return display order for dropdown list in web UI.Return a List of the groups allowed to run this WorkerKind.Return an optional description of this WorkerKind for use in the UI.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?boolean
Some customers have custom artifacts per user, which are passed to the Enterprise start script with the -u, -t, and -r options.boolean
True if temporary dispatcher produced class paths should be included on the command line with -C.boolean
True if -A "name" should be included on the command line.boolean
Check if this kind is a Community worker kindboolean
Are ephemeral virtual environments the default behavior for this worker?boolean
Does this produce a JVM that requires DHE specific JVM argumentsboolean
Does this produce a JVM that requires JVM like argumentsCreate a helper for generating a new command line.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, wait
Methods inherited from interface com.illumon.iris.db.tables.remotequery.WorkerKind
isLegacy
-
Constructor Details
-
GenericCommandWorkerKind
-
-
Method Details
-
workerControlTypes
Description copied from interface:WorkerKind
What kind of worker controls could be required for starting these kind of workers?- Specified by:
workerControlTypes
in interfaceWorkerKind
- Returns:
- the desired WorkerControlType
-
getWorkerControlTypeForRequest
Description copied from interface:WorkerKind
The worker control type required for a particular request.- Specified by:
getWorkerControlTypeForRequest
in interfaceWorkerKind
- Parameters:
request
- the request that a worker is being created for- Returns:
- the type of worker control for this particular request
-
implementedProtocols
Description copied from interface:WorkerKind
What protocols does this kind of worker implement?- Specified by:
implementedProtocols
in interfaceWorkerKind
- Returns:
- a list of protocol names that this worker implements
-
needsJvmFlags
public boolean needsJvmFlags()Description copied from interface:LocalProcessWorkerKind
Does this produce a JVM that requires JVM like arguments- Specified by:
needsJvmFlags
in interfaceLocalProcessWorkerKind
- Returns:
- true if this kind of worker needs JVM arguments
-
needsDheJvmFlags
public boolean needsDheJvmFlags()Description copied from interface:LocalProcessWorkerKind
Does this produce a JVM that requires DHE specific JVM arguments- Specified by:
needsDheJvmFlags
in interfaceLocalProcessWorkerKind
- Returns:
- true if this kind of worker needs DHE specific JVM arguments
-
includeNameArgument
public boolean includeNameArgument()Description copied from interface:LocalProcessWorkerKind
True if -A "name" should be included on the command line.- Specified by:
includeNameArgument
in interfaceLocalProcessWorkerKind
- Returns:
- true if the name argument is included
-
includeExtraClassPaths
public boolean includeExtraClassPaths()Description copied from interface:LocalProcessWorkerKind
True if temporary dispatcher produced class paths should be included on the command line with -C.- Specified by:
includeExtraClassPaths
in interfaceLocalProcessWorkerKind
- Returns:
- true if the dispatcher's temporary classpaths should be included
-
includeArtifactArguments
public boolean includeArtifactArguments()Description copied from interface:LocalProcessWorkerKind
Some 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:
includeArtifactArguments
in interfaceLocalProcessWorkerKind
- Returns:
- true if -u, -t, and -r options should be included
-
newCommandHelper
Description copied from interface:LocalProcessWorkerKind
Create a helper for generating a new command line.- Specified by:
newCommandHelper
in interfaceLocalProcessWorkerKind
- Returns:
- a new command line helper.
-
createPersistentQueryHandle
@NotNull public Object createPersistentQueryHandle(@NotNull com.fishlib.io.logger.Logger log, @NotNull Object queryHandleContext) Description copied from interface:WorkerKind
Create 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:
createPersistentQueryHandle
in 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
-
getDescription
Description copied from interface:WorkerKind
Return an optional description of this WorkerKind for use in the UI.- Specified by:
getDescription
in interfaceWorkerKind
- Returns:
- a description, or null
-
getTitle
Description copied from interface:WorkerKind
Return a string that should be used for drop-down menus in the UI.- Specified by:
getTitle
in interfaceWorkerKind
- Returns:
- the title of the worker
-
displayOrder
public int displayOrder()Description copied from interface:WorkerKind
Return 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:
displayOrder
in interfaceWorkerKind
-
isCommunity
public boolean isCommunity()Description copied from interface:WorkerKind
Check if this kind is a Community worker kind- Specified by:
isCommunity
in interfaceWorkerKind
- Returns:
- true if the worker kind is Community
-
isEphemeralVenvDefault
public boolean isEphemeralVenvDefault()Description copied from interface:WorkerKind
Are ephemeral virtual environments the default behavior for this worker?- Specified by:
isEphemeralVenvDefault
in interfaceWorkerKind
-
getAllowedGroups
Description copied from interface:WorkerKind
Return a List of the groups allowed to run this WorkerKind.- Specified by:
getAllowedGroups
in interfaceWorkerKind
- Returns:
- a List of the groups allowed to run this WorkerKind
-
commandPrefix
Description copied from interface:LocalProcessWorkerKind
If 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:
commandPrefix
in interfaceLocalProcessWorkerKind
- Returns:
- List of command and args used to launch a worker, or null if the property is not set.
-