public final class Utils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addToEnvironment(Map<String,String> environment,
String variable,
String value)
Copied method from org.apache.hadoop.yarn.util.Apps
It was broken by YARN-1824 (2.4.0) and fixed for 2.4.1
by https://issues.apache.org/jira/browse/YARN-1931
|
static int |
calculateHeapSize(int memory,
Configuration conf)
See documentation
|
static Map<String,String> |
getEnvironmentVariables(String envPrefix,
Configuration flinkConfiguration)
Method to extract environment variables from the flinkConfiguration based on the given prefix String.
|
static void |
registerLocalResource(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path remoteRsrcPath,
org.apache.hadoop.yarn.api.records.LocalResource localResource) |
static void |
setTokensFor(org.apache.hadoop.yarn.api.records.ContainerLaunchContext amContainer,
org.apache.hadoop.fs.Path[] paths,
org.apache.hadoop.conf.Configuration conf) |
static void |
setupEnv(org.apache.hadoop.conf.Configuration conf,
Map<String,String> appMasterEnv) |
static org.apache.hadoop.fs.Path |
setupLocalResource(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
String appId,
org.apache.hadoop.fs.Path localRsrcPath,
org.apache.hadoop.yarn.api.records.LocalResource appMasterJar,
org.apache.hadoop.fs.Path homedir) |
public static int calculateHeapSize(int memory, Configuration conf)
public static void setupEnv(org.apache.hadoop.conf.Configuration conf, Map<String,String> appMasterEnv)
public static org.apache.hadoop.fs.Path setupLocalResource(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, String appId, org.apache.hadoop.fs.Path localRsrcPath, org.apache.hadoop.yarn.api.records.LocalResource appMasterJar, org.apache.hadoop.fs.Path homedir) throws IOException
IOException
public static void registerLocalResource(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path remoteRsrcPath, org.apache.hadoop.yarn.api.records.LocalResource localResource) throws IOException
IOException
public static void setTokensFor(org.apache.hadoop.yarn.api.records.ContainerLaunchContext amContainer, org.apache.hadoop.fs.Path[] paths, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public static void addToEnvironment(Map<String,String> environment, String variable, String value)
public static Map<String,String> getEnvironmentVariables(String envPrefix, Configuration flinkConfiguration)
envPrefix
- Prefix for the environment variables keyflinkConfiguration
- The Flink config to get the environment variable defintion fromCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.