public enum ClientUtils extends Enum<ClientUtils>
Modifier and Type | Method and Description |
---|---|
static URLClassLoader |
buildUserCodeClassLoader(List<URL> jars,
List<URL> classpaths,
ClassLoader parent,
Configuration configuration) |
static void |
executeProgram(PipelineExecutorServiceLoader executorServiceLoader,
Configuration configuration,
PackagedProgram program,
boolean enforceSingleJobExecution,
boolean suppressSysout) |
static Collection<HttpHeader> |
readHeadersFromEnvironmentVariable(String envVarName) |
static ScheduledExecutorService |
reportHeartbeatPeriodically(JobClient jobClient,
long interval,
long timeout)
The client reports the heartbeat to the dispatcher for aliveness.
|
static ClientUtils |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ClientUtils[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static void |
waitUntilJobInitializationFinished(SupplierWithException<JobStatus,Exception> jobStatusSupplier,
SupplierWithException<JobResult,Exception> jobResultSupplier,
ClassLoader userCodeClassloader)
This method blocks until the job status is not INITIALIZING anymore.
|
public static ClientUtils[] values()
for (ClientUtils c : ClientUtils.values()) System.out.println(c);
public static ClientUtils valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static URLClassLoader buildUserCodeClassLoader(List<URL> jars, List<URL> classpaths, ClassLoader parent, Configuration configuration)
public static void executeProgram(PipelineExecutorServiceLoader executorServiceLoader, Configuration configuration, PackagedProgram program, boolean enforceSingleJobExecution, boolean suppressSysout) throws ProgramInvocationException
ProgramInvocationException
public static void waitUntilJobInitializationFinished(SupplierWithException<JobStatus,Exception> jobStatusSupplier, SupplierWithException<JobResult,Exception> jobResultSupplier, ClassLoader userCodeClassloader) throws JobInitializationException
jobStatusSupplier
- supplier returning the job status.jobResultSupplier
- supplier returning the job result. This will only be called if the
job reaches the FAILED state.JobInitializationException
- If the initialization failedpublic static ScheduledExecutorService reportHeartbeatPeriodically(JobClient jobClient, long interval, long timeout)
jobClient
- The job client.interval
- The heartbeat interval.timeout
- The heartbeat timeout.public static Collection<HttpHeader> readHeadersFromEnvironmentVariable(String envVarName)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.