Class RemoteProcessingProfileCustom
java.lang.Object
com.illumon.iris.db.tables.remotequery.RemoteProcessingProfileBase
com.illumon.iris.db.tables.remotequery.RemoteProcessingProfileCustom
- All Implemented Interfaces:
IRemoteProcessingProfile
Class to allow creation of custom JVM profiles. Each profile instance will have a name which will be used to read parameters from
property files.
To use a custom profile class, simply define one or more properties for it using the format:
RemoteProcessingRequestProfile.custom.<profile name>.<parameter type>.<parameter name>.
Parameters using the same profile name are all applied to the profile with that name.
Parameter names are arbitrary. The following types of properties are supported.
- JVM arguments using the parameter type jvmParameter. For example:
RemoteProcessingRequestProfile.custom.profileName.jvmParameter.parameterName=-XX:+UseStringDeduplication - Appendable JVM arguments using the parameter type jvmAppendableParameter. All appendable parameters must be in the format
name=value, and all the values with the same name will be combined into a single JVM parameter using the system's path separator (or another value specified with theRemoteProcessingRequestProfile.joinString.<parameter name>property). For example, the following would combine the two properties into a single JVM parameter of (on Linux)-Djava.library.path=/plugins/plugin1/bin:/plugins/plugin2/bin:
RemoteProcessingRequestProfile.custom.profileName.jvmAppendableParameter.libPath1=-Djava.library.path=/plugins/plugin1/bin
RemoteProcessingRequestProfile.custom.profileName.jvmAppendableParameter.libPath2=-Djava.library.path=/plugins/plugin2/bin - Environment variables using the parameter type environmentVariable. For example:
RemoteProcessingRequestProfile.Custom.profileName.environmentVariable.parameterName=my_env_variable=variableValue - In addition, other profiles can be specified specifying their names with the include option:
RemoteProcessingRequestProfile.custom.profileName.include
Multiple includes are allowed, either by adding additional (named) include directives or by using a comma-delimited list in the include directive. Included profiles will process their included profiles (recursively), but if a profile is included twice this is a configuration error and causes an exception.
-
Field Summary
Fields inherited from interface com.illumon.iris.db.tables.remotequery.IRemoteProcessingProfile
ENVIRONMENT_VARIABLE_ELEMENT, ENVIRONMENT_VARIABLE_NAME_ATTRIBUTE, ENVIRONMENT_VARIABLE_VALUE_ATTRIBUTE, JVM_PARAMETER_ATTRIBUTE, JVM_PARAMETER_ELEMENT -
Constructor Summary
ConstructorsConstructorDescriptionRemoteProcessingProfileCustom(String profileName, com.fishlib.configuration.Configuration configuration) This constructor is used when reading the properties.RemoteProcessingProfileCustom(org.jdom2.Element profileElement) This constructor is used to generate an instance given a profile Element. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddJvmArguments(int maxHeapSizeMB, List<String> basicJvmArguments, Map<String, List<String>> appendableJvmArguments) Add this profile's JVM parameters to the provided parameters.org.jdom2.ElementGenerate an XML Element that represents this profile.Get the displayable name.Get the environment variables.Return a List of included profile names.String[]getJvmArgs(int maxHeapSizeMB) Get the JVM arguments to be passed to the JVM.
-
Constructor Details
-
RemoteProcessingProfileCustom
public RemoteProcessingProfileCustom(String profileName, com.fishlib.configuration.Configuration configuration) This constructor is used when reading the properties.- Parameters:
profileName- the name of the profileconfiguration- the Configuration instance
-
RemoteProcessingProfileCustom
public RemoteProcessingProfileCustom(org.jdom2.Element profileElement) This constructor is used to generate an instance given a profile Element.- Parameters:
profileElement- the previously-generated Element for this profile
-
-
Method Details
-
getJvmArgs
Description copied from interface:IRemoteProcessingProfileGet the JVM arguments to be passed to the JVM. These may be calculated based on the configured max heap size.- Parameters:
maxHeapSizeMB- the worker's maximum heap size in MB- Returns:
- the JVM parameters to be passed to the JVM
-
addJvmArguments
public void addJvmArguments(int maxHeapSizeMB, List<String> basicJvmArguments, Map<String, List<String>> appendableJvmArguments) Description copied from interface:IRemoteProcessingProfileAdd this profile's JVM parameters to the provided parameters. This includes arguments for included profiles.- Parameters:
maxHeapSizeMB- the worker's maximum heap size in MBbasicJvmArguments- a List to which the basic arguments for this profile and any included profiles will be addedappendableJvmArguments- a Map to which appendable arguments for this profile and any included profiles will be added
-
getEnvironmentVariables
Description copied from interface:IRemoteProcessingProfileGet the environment variables.- Returns:
- a Map of the environment variable names to values
-
getDisplayName
Description copied from interface:IRemoteProcessingProfileGet the displayable name.- Returns:
- The displayable name
-
generateProfileXML
public org.jdom2.Element generateProfileXML()Description copied from interface:IRemoteProcessingProfileGenerate an XML Element that represents this profile.- Returns:
- the generated XML Element
-
getIncludedProfileNames
Description copied from interface:IRemoteProcessingProfileReturn a List of included profile names.- Returns:
- the included profile names
-