Java Code Examples for org.apache.flink.configuration.ConfigOption#hasDefaultValue()
The following examples show how to use
org.apache.flink.configuration.ConfigOption#hasDefaultValue() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AthenaXConfiguration.java From AthenaX with Apache License 2.0 | 5 votes |
public long getExtraConfLong(ConfigOption<Long> config) { Object o = extras().get(config.key()); if (config.hasDefaultValue()) { return o == null ? config.defaultValue() : Long.parseLong(o.toString()); } else { throw new IllegalArgumentException("Unspecified config " + config.key()); } }
Example 2
Source File: TaskExecutorResourceUtils.java From flink with Apache License 2.0 | 4 votes |
private static void checkConfigOptionIsSet(Configuration config, ConfigOption<?> option) { if (!config.contains(option) && !option.hasDefaultValue()) { throw new IllegalConfigurationException("The required configuration option %s is not set", option); } }