public class ParameterTool extends org.apache.flink.api.common.ExecutionConfig.GlobalJobParameters implements Serializable, Cloneable
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
data |
protected static String |
DEFAULT_UNDEFINED |
protected HashMap<String,String> |
defaultData |
protected static String |
NO_VALUE_KEY |
Modifier and Type | Method and Description |
---|---|
protected void |
addToDefaults(String key,
String value) |
protected Object |
clone() |
void |
createPropertiesFile(String pathToFile)
Create a properties file with all the known parameters (call after the last get*() call).
|
void |
createPropertiesFile(String pathToFile,
boolean overwrite) |
static ParameterTool |
fromArgs(String[] args) |
static ParameterTool |
fromMap(Map<String,String> map) |
static ParameterTool |
fromPropertiesFile(String path) |
static ParameterTool |
fromSystemProperties() |
String |
get(String key) |
String |
get(String key,
String defaultValue) |
org.apache.flink.configuration.Configuration |
getConfiguration() |
double |
getDouble(String key) |
double |
getDouble(String key,
double defaultValue) |
float |
getFloat(String key) |
float |
getFloat(String key,
float defaultValue) |
int |
getInt(String key) |
int |
getInt(String key,
int defaultValue) |
long |
getLong(String key)
Get long value.
|
long |
getLong(String key,
long defaultValue) |
int |
getNumberOfParameters() |
Properties |
getProperties() |
String |
getRequired(String key) |
boolean |
has(String value)
Check if value is set
|
ParameterTool |
mergeWith(ParameterTool other) |
Map<String,String> |
toMap() |
protected static String NO_VALUE_KEY
protected static String DEFAULT_UNDEFINED
public static ParameterTool fromArgs(String[] args)
public static ParameterTool fromPropertiesFile(String path) throws IOException
IOException
public static ParameterTool fromMap(Map<String,String> map)
public static ParameterTool fromSystemProperties()
public int getNumberOfParameters()
public boolean has(String value)
public int getInt(String key)
public int getInt(String key, int defaultValue)
public long getLong(String key)
key
- Name of the keypublic long getLong(String key, long defaultValue)
public float getFloat(String key)
public float getFloat(String key, float defaultValue)
public double getDouble(String key)
public double getDouble(String key, double defaultValue)
public org.apache.flink.configuration.Configuration getConfiguration()
public Properties getProperties()
public void createPropertiesFile(String pathToFile) throws IOException
pathToFile
- Location of the default properties file.IOException
public void createPropertiesFile(String pathToFile, boolean overwrite) throws IOException
IOException
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public ParameterTool mergeWith(ParameterTool other)
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.