Class LHWorkerConfig


  • public class LHWorkerConfig
    extends LHClientConfig
    This is a configuration class for the Task Workers.
    • Field Detail

      • NUM_WORKER_THREADS_KEY

        public static final java.lang.String NUM_WORKER_THREADS_KEY
        The number of worker threads to run.
        See Also:
        Constant Field Values
      • SERVER_CONNECT_LISTENER_KEY

        public static final java.lang.String SERVER_CONNECT_LISTENER_KEY
        Listener to connect to.
        See Also:
        Constant Field Values
      • TASK_WORKER_VERSION_KEY

        public static final java.lang.String TASK_WORKER_VERSION_KEY
        See Also:
        Constant Field Values
      • DEFAULT_PUBLIC_LISTENER

        public static final java.lang.String DEFAULT_PUBLIC_LISTENER
        See Also:
        Constant Field Values
    • Constructor Detail

      • LHWorkerConfig

        public LHWorkerConfig()
        Creates an LHWorkerConfig using the environment variables as defaults.
      • LHWorkerConfig

        public LHWorkerConfig​(java.util.Properties props)
        Creates an LHWorkerConfig with provided properties.
        Parameters:
        props - config values.
      • LHWorkerConfig

        public LHWorkerConfig​(java.lang.String propLocation)
        Creates an LHWorkerConfig with a .properties file.
        Parameters:
        propLocation - is the location of the .properties file.
      • LHWorkerConfig

        public LHWorkerConfig​(java.util.Map<java.lang.String,​java.lang.Object> configs)
        Creates an LHWorkerConfig with provided config values.
        Parameters:
        configs - configuration values.
    • Method Detail

      • configNames

        public static java.util.Set<java.lang.String> configNames()
      • getTaskDef

        public io.littlehorse.sdk.common.proto.TaskDefPb getTaskDef​(java.lang.String taskDefName)
        Gets the `TaskDefPb` for a given taskDefName.
        Parameters:
        taskDefName - is the TaskDef's name.
        Returns:
        the specified TaskDefPb.
      • getTaskWorkerVersion

        public java.lang.String getTaskWorkerVersion()
        Returns the TaskWorker Version of this worker.
        Returns:
        Task Worker Version.
      • getApiBootstrapHost

        public java.lang.String getApiBootstrapHost()
        Returns the API BootStrap Host.
        Overrides:
        getApiBootstrapHost in class LHClientConfig
        Returns:
        the API Bootstrap Host.
      • getApiBootstrapPort

        public int getApiBootstrapPort()
        Returns the API Bootstrap Port.
        Overrides:
        getApiBootstrapPort in class LHClientConfig
        Returns:
        the API Bootstrap port.
      • getConnectListener

        public java.lang.String getConnectListener()
        Returns the name of the listener to connect to.
        Returns:
        the name of the listener on the LH Server to connect to.
      • getWorkerThreads

        public int getWorkerThreads()
        Returns the number of worker threads to run.
        Returns:
        the number of worker threads to run.