Package io.littlehorse.sdk.common.config
Class LHWorkerConfig
- java.lang.Object
-
- io.littlehorse.sdk.common.config.ConfigBase
-
- io.littlehorse.sdk.common.config.LHClientConfig
-
- io.littlehorse.sdk.common.config.LHWorkerConfig
-
public class LHWorkerConfig extends LHClientConfig
This is a configuration class for the Task Workers.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_PUBLIC_LISTENERstatic java.lang.StringNUM_WORKER_THREADS_KEYThe number of worker threads to run.static java.lang.StringSERVER_CONNECT_LISTENER_KEYListener to connect to.static java.lang.StringTASK_WORKER_VERSION_KEY-
Fields inherited from class io.littlehorse.sdk.common.config.LHClientConfig
API_HOST_KEY, API_PORT_KEY, CA_CERT_KEY, CLIENT_CERT_KEY, CLIENT_ID_KEY, CLIENT_KEY_KEY, OAUTH_AUTHORIZATION_SERVER_KEY, OAUTH_CLIENT_ID_KEY, OAUTH_CLIENT_SECRET_KEY
-
-
Constructor Summary
Constructors Constructor Description LHWorkerConfig()Creates an LHWorkerConfig using the environment variables as defaults.LHWorkerConfig(java.lang.String propLocation)Creates an LHWorkerConfig with a .properties file.LHWorkerConfig(java.util.Map<java.lang.String,java.lang.Object> configs)Creates an LHWorkerConfig with provided config values.LHWorkerConfig(java.util.Properties props)Creates an LHWorkerConfig with provided properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Set<java.lang.String>configNames()java.lang.StringgetApiBootstrapHost()Returns the API BootStrap Host.intgetApiBootstrapPort()Returns the API Bootstrap Port.java.lang.StringgetConnectListener()Returns the name of the listener to connect to.io.littlehorse.sdk.common.proto.TaskDefPbgetTaskDef(java.lang.String taskDefName)Gets the `TaskDefPb` for a given taskDefName.java.lang.StringgetTaskWorkerVersion()Returns the TaskWorker Version of this worker.intgetWorkerThreads()Returns the number of worker threads to run.-
Methods inherited from class io.littlehorse.sdk.common.config.LHClientConfig
getAsyncStub, getAsyncStub, getBlockingStub, getBlockingStub, getClientId, isOauth
-
-
-
-
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:
getApiBootstrapHostin classLHClientConfig- Returns:
- the API Bootstrap Host.
-
getApiBootstrapPort
public int getApiBootstrapPort()
Returns the API Bootstrap Port.- Overrides:
getApiBootstrapPortin classLHClientConfig- 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.
-
-