Class EnvUtils
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.utils.EnvUtils
-
public class EnvUtils extends java.lang.Object
Util to get value from environments.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ENV_CONF_OVERRIDE_DIR
static java.lang.String
ENV_HOSTNAME
static java.lang.String
ENV_KUBERNETES_SERVICE_HOST
static java.lang.String
ENV_OPERATOR_NAME
static java.lang.String
ENV_OPERATOR_NAMESPACE
static java.lang.String
ENV_WATCH_NAMESPACES
static java.lang.String
ENV_WEBHOOK_KEYSTORE_FILE
static java.lang.String
ENV_WEBHOOK_KEYSTORE_PASSWORD
static java.lang.String
ENV_WEBHOOK_KEYSTORE_TYPE
static java.lang.String
ENV_WEBHOOK_SERVER_PORT
-
Constructor Summary
Constructors Constructor Description EnvUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<java.lang.String>
get(java.lang.String key)
Get the value provided by environments.static java.lang.String
getOrDefault(java.lang.String key, java.lang.String defaultValue)
Get the value or default value provided by environments.static java.lang.String
getRequired(java.lang.String key)
Get the value provided by environments.static void
logEnvironmentInfo(org.slf4j.Logger log, java.lang.String componentName, java.lang.String[] commandLineArgs)
Logs information about the environment, like code revision, current user, Java version, and JVM parameters.
-
-
-
Field Detail
-
ENV_KUBERNETES_SERVICE_HOST
public static final java.lang.String ENV_KUBERNETES_SERVICE_HOST
- See Also:
- Constant Field Values
-
ENV_WEBHOOK_KEYSTORE_FILE
public static final java.lang.String ENV_WEBHOOK_KEYSTORE_FILE
- See Also:
- Constant Field Values
-
ENV_WEBHOOK_KEYSTORE_PASSWORD
public static final java.lang.String ENV_WEBHOOK_KEYSTORE_PASSWORD
- See Also:
- Constant Field Values
-
ENV_WEBHOOK_KEYSTORE_TYPE
public static final java.lang.String ENV_WEBHOOK_KEYSTORE_TYPE
- See Also:
- Constant Field Values
-
ENV_WEBHOOK_SERVER_PORT
public static final java.lang.String ENV_WEBHOOK_SERVER_PORT
- See Also:
- Constant Field Values
-
ENV_CONF_OVERRIDE_DIR
public static final java.lang.String ENV_CONF_OVERRIDE_DIR
- See Also:
- Constant Field Values
-
ENV_HOSTNAME
public static final java.lang.String ENV_HOSTNAME
- See Also:
- Constant Field Values
-
ENV_OPERATOR_NAME
public static final java.lang.String ENV_OPERATOR_NAME
- See Also:
- Constant Field Values
-
ENV_OPERATOR_NAMESPACE
public static final java.lang.String ENV_OPERATOR_NAMESPACE
- See Also:
- Constant Field Values
-
ENV_WATCH_NAMESPACES
public static final java.lang.String ENV_WATCH_NAMESPACES
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public static java.util.Optional<java.lang.String> get(java.lang.String key)
Get the value provided by environments.- Parameters:
key
- the target key- Returns:
- the value value provided by environments.
-
getOrDefault
public static java.lang.String getOrDefault(java.lang.String key, java.lang.String defaultValue)
Get the value or default value provided by environments.- Parameters:
key
- the target keydefaultValue
- the default value if key not exists.- Returns:
- the value or default value provided by environments.
-
getRequired
public static java.lang.String getRequired(java.lang.String key)
Get the value provided by environments.- Parameters:
key
- the target key- Returns:
- the value provided by environments.
-
logEnvironmentInfo
public static void logEnvironmentInfo(org.slf4j.Logger log, java.lang.String componentName, java.lang.String[] commandLineArgs)
Logs information about the environment, like code revision, current user, Java version, and JVM parameters.- Parameters:
log
- The logger to log the information to.componentName
- The component name to mention in the log.commandLineArgs
- The arguments accompanying the starting the component.
-
-