@Public public class ParameterTool extends AbstractParameterTool
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
data |
DEFAULT_UNDEFINED, defaultData, NO_VALUE_KEY, unrequestedParameters| Modifier and Type | Method and Description |
|---|---|
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)
Create a properties file with all the known parameters (call after the last get*() call).
|
boolean |
equals(Object o) |
static ParameterTool |
fromArgs(String[] args)
Returns
ParameterTool for the given arguments. |
static ParameterTool |
fromMap(Map<String,String> map)
Returns
ParameterTool for the given map. |
static ParameterTool |
fromPropertiesFile(File file)
Returns
ParameterTool for the given Properties file. |
static ParameterTool |
fromPropertiesFile(InputStream inputStream)
Returns
ParameterTool for the given InputStream from Properties file. |
static ParameterTool |
fromPropertiesFile(String path)
Returns
ParameterTool for the given Properties file. |
static ParameterTool |
fromSystemProperties()
Returns
ParameterTool from the system properties. |
String |
get(String key)
Returns the String value for the given key.
|
org.apache.flink.configuration.Configuration |
getConfiguration()
Returns a
Configuration object from this ParameterTool. |
int |
getNumberOfParameters()
Returns number of parameters in
ParameterTool. |
Properties |
getProperties()
Returns a
Properties object from this ParameterTool. |
boolean |
has(String value)
Check if value is set.
|
int |
hashCode() |
ParameterTool |
mergeWith(ParameterTool other)
Merges two
ParameterTool. |
Map<String,String> |
toMap() |
addToDefaults, get, getBoolean, getBoolean, getByte, getByte, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getRequired, getShort, getShort, getUnrequestedParameterspublic static ParameterTool fromArgs(String[] args)
ParameterTool for the given arguments. The arguments are keys followed by
values. Keys have to start with '-' or '--'
Example arguments: --key1 value1 --key2 value2 -key3 value3
args - Input array argumentsParameterToolpublic static ParameterTool fromPropertiesFile(String path) throws IOException
ParameterTool for the given Properties file.path - Path to the properties fileParameterToolIOException - If the file does not existPropertiespublic static ParameterTool fromPropertiesFile(File file) throws IOException
ParameterTool for the given Properties file.file - File object to the properties fileParameterToolIOException - If the file does not existPropertiespublic static ParameterTool fromPropertiesFile(InputStream inputStream) throws IOException
ParameterTool for the given InputStream from Properties file.inputStream - InputStream from the properties fileParameterToolIOException - If the file does not existPropertiespublic static ParameterTool fromMap(Map<String,String> map)
ParameterTool for the given map.map - A map of arguments. Both Key and Value have to be StringsParameterToolpublic static ParameterTool fromSystemProperties()
ParameterTool from the system properties. Example on how to pass system
properties: -Dkey1=value1 -Dkey2=value2ParameterToolpublic boolean equals(Object o)
equals in class org.apache.flink.api.common.ExecutionConfig.GlobalJobParameterspublic int hashCode()
hashCode in class org.apache.flink.api.common.ExecutionConfig.GlobalJobParameterspublic int getNumberOfParameters()
ParameterTool.getNumberOfParameters in class AbstractParameterToolpublic String get(String key)
get in class AbstractParameterToolpublic boolean has(String value)
has in class AbstractParameterToolpublic org.apache.flink.configuration.Configuration getConfiguration()
Configuration object from this ParameterTool.Configurationpublic Properties getProperties()
Properties object from this ParameterTool.Propertiespublic void createPropertiesFile(String pathToFile) throws IOException
Use this method to create a properties file skeleton.
pathToFile - Location of the default properties file.IOExceptionpublic void createPropertiesFile(String pathToFile, boolean overwrite) throws IOException
pathToFile - Location of the default properties file.overwrite - Boolean flag indicating whether or not to overwrite the fileIOException - If overwrite is not allowed and the file existsprotected Object clone() throws CloneNotSupportedException
clone in class AbstractParameterToolCloneNotSupportedExceptionpublic ParameterTool mergeWith(ParameterTool other)
ParameterTool.other - Other ParameterTool objectParameterToolpublic Map<String,String> toMap()
toMap in class AbstractParameterToolCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.