Class GenericCommandWorkerKind
- All Implemented Interfaces:
LocalProcessWorkerKind
,WorkerKind
public class GenericCommandWorkerKind extends Object implements WorkerKind, LocalProcessWorkerKind
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>.includeArtifactArgumetns | Include -u, -t, and -r arguments for the artifact download script. |
-
Field Summary
-
Constructor Summary
Constructors Constructor Description GenericCommandWorkerKind(String name)
-
Method Summary
Modifier and Type Method Description List<String>
getBaseCommand(String workerCreationJson, String processUserName, List<String> runAsParams)
Create the beginning of the new worker's command.String
getWorkerControlTypeForRequest(RemoteProcessingRequest request)
The worker control type required for a particular request.boolean
includeArtifactArguments()
Some customers have custom artifacts per user, which are passed to the Enterprise start script with the -u, -t, and -r options.boolean
includeExtraClassPaths()
True if temporary dispatcher produced class paths should be included on the command line with -C.boolean
includeNameArgument()
True if -A "name" should be included on the command line.boolean
needsDheJvmFlags()
Does this produce a JVM that requires DHE specific JVM argumentsboolean
needsJavaOptsEnv()
Does this produce a JVM that requires JVM arguments via a JAVA_OPTS environment variable.boolean
needsJvmFlags()
Does this produce a JVM that requires JVM like argumentsCollection<String>
workerControlTypes()
What kind of worker controls could be required for starting these kind of workers?
-
Constructor Details
-
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
-
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
-
needsJavaOptsEnv
public boolean needsJavaOptsEnv()Description copied from interface:LocalProcessWorkerKind
Does this produce a JVM that requires JVM arguments via a JAVA_OPTS environment variable.- Specified by:
needsJavaOptsEnv
in interfaceLocalProcessWorkerKind
- Returns:
- true if this kind of worker needs a JAVA_OPTS environment variable.
-
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
-
getBaseCommand
public List<String> getBaseCommand(String workerCreationJson, String processUserName, List<String> runAsParams)Description copied from interface:LocalProcessWorkerKind
Create the beginning of the new worker's command.- Specified by:
getBaseCommand
in interfaceLocalProcessWorkerKind
- Parameters:
workerCreationJson
- the JSON passed by the remote processing requestprocessUserName
- the user name that the process will execute asrunAsParams
- the parameters for running as a distinct system user- Returns:
- a new list with the beginning of the command to execute
-