Package org.apache.spark
Interface ReadOnlySparkConf
- All Known Implementing Classes:
SparkConf
public interface ReadOnlySparkConf
-
Method Summary
Modifier and TypeMethodDescription<T> T
catchIllegalValue
(String key, scala.Function0<T> getValue) Wrapper method for get() methods which require some specific value format.boolean
Does the configuration contain a given parameter?boolean
contains
(org.apache.spark.internal.config.ConfigEntry<?> entry) Does the configuration have the typed config entry?Get a parameter; throws a NoSuchElementException if it's not setGet a parameter, falling back to a default if not set<T> T
get
(org.apache.spark.internal.config.ConfigEntry<T> entry) Retrieves the value of a pre-defined configuration entry.getAll()
Get all parameters as a list of pairsboolean
getBoolean
(String key, boolean defaultValue) Get a parameter as a boolean, falling back to a default if not setdouble
Get a parameter as a double, falling back to a default if not steint
Get a parameter as an integer, falling back to a default if not setlong
Get a parameter as a long, falling back to a default if not setscala.Option<String>
Get a parameter as an Optionlong
getSizeAsBytes
(String key) Get a size parameter as bytes; throws a NoSuchElementException if it's not set.long
getSizeAsBytes
(String key, long defaultValue) Get a size parameter as bytes, falling back to a default if not set.long
getSizeAsBytes
(String key, String defaultValue) Get a size parameter as bytes, falling back to a default if not set.long
getSizeAsGb
(String key) Get a size parameter as Gibibytes; throws a NoSuchElementException if it's not set.long
getSizeAsGb
(String key, String defaultValue) Get a size parameter as Gibibytes, falling back to a default if not set.long
getSizeAsKb
(String key) Get a size parameter as Kibibytes; throws a NoSuchElementException if it's not set.long
getSizeAsKb
(String key, String defaultValue) Get a size parameter as Kibibytes, falling back to a default if not set.long
getSizeAsMb
(String key) Get a size parameter as Mebibytes; throws a NoSuchElementException if it's not set.long
getSizeAsMb
(String key, String defaultValue) Get a size parameter as Mebibytes, falling back to a default if not set.long
getTimeAsMs
(String key) Get a time parameter as milliseconds; throws a NoSuchElementException if it's not set.long
getTimeAsMs
(String key, String defaultValue) Get a time parameter as milliseconds, falling back to a default if not set.long
getTimeAsSeconds
(String key) Get a time parameter as seconds; throws a NoSuchElementException if it's not set.long
getTimeAsSeconds
(String key, String defaultValue) Get a time parameter as seconds, falling back to a default if not set.
-
Method Details
-
catchIllegalValue
Wrapper method for get() methods which require some specific value format. This catches anyNumberFormatException
orIllegalArgumentException
and re-raises it with the incorrectly configured key in the exception message.- Parameters:
key
- (undocumented)getValue
- (undocumented)- Returns:
- (undocumented)
-
contains
Does the configuration contain a given parameter? -
contains
boolean contains(org.apache.spark.internal.config.ConfigEntry<?> entry) Does the configuration have the typed config entry? -
get
Get a parameter; throws a NoSuchElementException if it's not set -
get
Get a parameter, falling back to a default if not set -
get
<T> T get(org.apache.spark.internal.config.ConfigEntry<T> entry) Retrieves the value of a pre-defined configuration entry.- This is an internal Spark API. - The return type if defined by the configuration entry. - This will throw an exception is the config is not optional and the value is not set.
- Parameters:
entry
- (undocumented)- Returns:
- (undocumented)
-
getAll
Get all parameters as a list of pairs -
getBoolean
Get a parameter as a boolean, falling back to a default if not set- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
IllegalArgumentException
- If the value cannot be interpreted as a boolean
-
getDouble
Get a parameter as a double, falling back to a default if not ste- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as a double
-
getInt
Get a parameter as an integer, falling back to a default if not set- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as an integer
-
getLong
Get a parameter as a long, falling back to a default if not set- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as a long
-
getOption
Get a parameter as an Option -
getSizeAsBytes
Get a size parameter as bytes; throws a NoSuchElementException if it's not set. If no suffix is provided then bytes are assumed.- Parameters:
key
- (undocumented)- Returns:
- (undocumented)
- Throws:
NoSuchElementException
- If the size parameter is not setNumberFormatException
- If the value cannot be interpreted as bytes
-
getSizeAsBytes
Get a size parameter as bytes, falling back to a default if not set. If no suffix is provided then bytes are assumed.- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as bytes
-
getSizeAsBytes
Get a size parameter as bytes, falling back to a default if not set.- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as bytes
-
getSizeAsGb
Get a size parameter as Gibibytes; throws a NoSuchElementException if it's not set. If no suffix is provided then Gibibytes are assumed.- Parameters:
key
- (undocumented)- Returns:
- (undocumented)
- Throws:
NoSuchElementException
- If the size parameter is not setNumberFormatException
- If the value cannot be interpreted as Gibibytes
-
getSizeAsGb
Get a size parameter as Gibibytes, falling back to a default if not set. If no suffix is provided then Gibibytes are assumed.- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as Gibibytes
-
getSizeAsKb
Get a size parameter as Kibibytes; throws a NoSuchElementException if it's not set. If no suffix is provided then Kibibytes are assumed.- Parameters:
key
- (undocumented)- Returns:
- (undocumented)
- Throws:
NoSuchElementException
- If the size parameter is not setNumberFormatException
- If the value cannot be interpreted as Kibibytes
-
getSizeAsKb
Get a size parameter as Kibibytes, falling back to a default if not set. If no suffix is provided then Kibibytes are assumed.- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as Kibibytes
-
getSizeAsMb
Get a size parameter as Mebibytes; throws a NoSuchElementException if it's not set. If no suffix is provided then Mebibytes are assumed.- Parameters:
key
- (undocumented)- Returns:
- (undocumented)
- Throws:
NoSuchElementException
- If the size parameter is not setNumberFormatException
- If the value cannot be interpreted as Mebibytes
-
getSizeAsMb
Get a size parameter as Mebibytes, falling back to a default if not set. If no suffix is provided then Mebibytes are assumed.- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as Mebibytes
-
getTimeAsMs
Get a time parameter as milliseconds; throws a NoSuchElementException if it's not set. If no suffix is provided then milliseconds are assumed.- Parameters:
key
- (undocumented)- Returns:
- (undocumented)
- Throws:
NoSuchElementException
- If the time parameter is not setNumberFormatException
- If the value cannot be interpreted as milliseconds
-
getTimeAsMs
Get a time parameter as milliseconds, falling back to a default if not set. If no suffix is provided then milliseconds are assumed.- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as milliseconds
-
getTimeAsSeconds
Get a time parameter as seconds; throws a NoSuchElementException if it's not set. If no suffix is provided then seconds are assumed.- Parameters:
key
- (undocumented)- Returns:
- (undocumented)
- Throws:
NoSuchElementException
- If the time parameter is not setNumberFormatException
- If the value cannot be interpreted as seconds
-
getTimeAsSeconds
Get a time parameter as seconds, falling back to a default if not set. If no suffix is provided then seconds are assumed.- Parameters:
key
- (undocumented)defaultValue
- (undocumented)- Returns:
- (undocumented)
- Throws:
NumberFormatException
- If the value cannot be interpreted as seconds
-