Class RemoteProcessingProfileCustom

java.lang.Object
com.illumon.iris.db.tables.remotequery.RemoteProcessingProfileBase
com.illumon.iris.db.tables.remotequery.RemoteProcessingProfileCustom
All Implemented Interfaces:
IRemoteProcessingProfile

public class RemoteProcessingProfileCustom
extends RemoteProcessingProfileBase
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 the RemoteProcessingRequestProfile.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.
  • 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 profile
      configuration - 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

      public String[] getJvmArgs​(int maxHeapSizeMB)
      Description copied from interface: IRemoteProcessingProfile
      Get 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: IRemoteProcessingProfile
      Add this profile's JVM parameters to the provided parameters. This includes arguments for included profiles.
      Parameters:
      maxHeapSizeMB - the worker's maximum heap size in MB
      basicJvmArguments - a List to which the basic arguments for this profile and any included profiles will be added
      appendableJvmArguments - a Map to which appendable arguments for this profile and any included profiles will be added
    • getEnvironmentVariables

      @NotNull public Map<String,​String> getEnvironmentVariables()
      Description copied from interface: IRemoteProcessingProfile
      Get the environment variables.
      Returns:
      a Map of the environment variable names to values
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: IRemoteProcessingProfile
      Get the displayable name.
      Returns:
      The displayable name
    • generateProfileXML

      public org.jdom2.Element generateProfileXML()
      Description copied from interface: IRemoteProcessingProfile
      Generate an XML Element that represents this profile.
      Returns:
      the generated XML Element
    • getIncludedProfileNames

      public List<String> getIncludedProfileNames()
      Description copied from interface: IRemoteProcessingProfile
      Return a List of included profile names.
      Returns:
      the included profile names