public final class ClusterEntrypointUtils extends Object
ClusterEntrypoint
.Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
static void |
configureUncaughtExceptionHandler(Configuration config)
Sets the uncaught exception handler for current thread based on configuration.
|
static DeterminismEnvelope<WorkingDirectory> |
createJobManagerWorkingDirectory(Configuration configuration,
DeterminismEnvelope<ResourceID> envelopedResourceId)
Creates the working directory for the JobManager process.
|
static DeterminismEnvelope<WorkingDirectory> |
createTaskManagerWorkingDirectory(Configuration configuration,
DeterminismEnvelope<ResourceID> envelopedResourceId)
Creates the working directory for the TaskManager process.
|
static File |
generateJobManagerWorkingDirectoryFile(Configuration configuration,
ResourceID resourceId)
Generates the working directory
File for the JobManager process. |
static File |
generateTaskManagerWorkingDirectoryFile(Configuration configuration,
ResourceID resourceId)
Generates the working directory
File for the TaskManager process. |
static File |
generateWorkingDirectoryFile(Configuration configuration,
Optional<ConfigOption<String>> workingDirOption,
String workingDirectoryName)
Generate the working directory from the given configuration.
|
static int |
getPoolSize(Configuration config)
Gets and verify the io-executor pool size based on configuration.
|
static <T> T |
parseParametersOrExit(String[] args,
ParserResultFactory<T> parserResultFactory,
Class<?> mainClass)
Parses passed String array using the parameter definitions of the passed
ParserResultFactory . |
static Optional<File> |
tryFindUserLibDirectory()
Tries to find the user library directory.
|
public static <T> T parseParametersOrExit(String[] args, ParserResultFactory<T> parserResultFactory, Class<?> mainClass)
ParserResultFactory
. The method will call System.exit
and print the usage
information to stdout in case of a parsing error.T
- The parsing result type.args
- The String array that shall be parsed.parserResultFactory
- The ParserResultFactory
that collects the parameter
parsing instructions.mainClass
- The main class initiating the parameter parsing.public static Optional<File> tryFindUserLibDirectory()
Optional.empty()
if there is
nonepublic static int getPoolSize(Configuration config)
config
- The configuration to read.public static void configureUncaughtExceptionHandler(Configuration config)
config
- the configuration to read.public static DeterminismEnvelope<WorkingDirectory> createTaskManagerWorkingDirectory(Configuration configuration, DeterminismEnvelope<ResourceID> envelopedResourceId) throws IOException
configuration
- to extract the required settings fromenvelopedResourceId
- identifying the TaskManager processIOException
- if the working directory could not be created@VisibleForTesting public static File generateTaskManagerWorkingDirectoryFile(Configuration configuration, ResourceID resourceId)
File
for the TaskManager process. This method does
not ensure that the working directory exists.configuration
- to extract the required settings fromresourceId
- identifying the TaskManager process@VisibleForTesting public static File generateJobManagerWorkingDirectoryFile(Configuration configuration, ResourceID resourceId)
File
for the JobManager process. This method does not
ensure that the working directory exists.configuration
- to extract the required settings fromresourceId
- identifying the JobManager processpublic static File generateWorkingDirectoryFile(Configuration configuration, Optional<ConfigOption<String>> workingDirOption, String workingDirectoryName)
CoreOptions.TMP_DIRS
will be used to extract the working directory base from.configuration
- to extract the working directory fromworkingDirOption
- optional working dir optionworkingDirectoryName
- name of the working directory to createpublic static DeterminismEnvelope<WorkingDirectory> createJobManagerWorkingDirectory(Configuration configuration, DeterminismEnvelope<ResourceID> envelopedResourceId) throws IOException
configuration
- to extract the required settings fromenvelopedResourceId
- identifying the TaskManager processIOException
- if the working directory could not be createdCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.