本文整理了Java中org.apache.flink.configuration.Configuration.removeConfig()
方法的一些代码示例,展示了Configuration.removeConfig()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.removeConfig()
方法的具体详情如下:
包路径:org.apache.flink.configuration.Configuration
类名称:Configuration
方法名:removeConfig
[英]Removes given config option from the configuration.
[中]从配置中删除给定的配置选项。
代码示例来源:origin: apache/flink
@Override
public <T> boolean removeConfig(ConfigOption<T> configOption){
return backingConfig.removeConfig(configOption);
}
代码示例来源:origin: apache/flink
@Test
public void testRemove(){
Configuration cfg = new Configuration();
cfg.setInteger("a", 1);
cfg.setInteger("b", 2);
ConfigOption<Integer> validOption = ConfigOptions
.key("a")
.defaultValue(-1);
ConfigOption<Integer> deprecatedOption = ConfigOptions
.key("c")
.defaultValue(-1)
.withDeprecatedKeys("d", "b");
ConfigOption<Integer> unexistedOption = ConfigOptions
.key("e")
.defaultValue(-1)
.withDeprecatedKeys("f", "g", "j");
assertEquals("Wrong expectation about size", cfg.keySet().size(), 2);
assertTrue("Expected 'validOption' is removed", cfg.removeConfig(validOption));
assertEquals("Wrong expectation about size", cfg.keySet().size(), 1);
assertTrue("Expected 'existedOption' is removed", cfg.removeConfig(deprecatedOption));
assertEquals("Wrong expectation about size", cfg.keySet().size(), 0);
assertFalse("Expected 'unexistedOption' is not removed", cfg.removeConfig(unexistedOption));
}
}
代码示例来源:origin: org.apache.flink/flink-core
@Override
public <T> boolean removeConfig(ConfigOption<T> configOption){
return backingConfig.removeConfig(configOption);
}
代码示例来源:origin: org.apache.flink/flink-runtime
/**
* Clones the given configuration and resets instance specific config options.
*
* @param configuration to clone
* @return Cloned configuration with reset instance specific config options
*/
public static Configuration cloneConfiguration(Configuration configuration) {
final Configuration clonedConfiguration = new Configuration(configuration);
if (clonedConfiguration.getBoolean(USE_LOCAL_DEFAULT_TMP_DIRS)){
clonedConfiguration.removeConfig(CoreOptions.TMP_DIRS);
clonedConfiguration.removeConfig(USE_LOCAL_DEFAULT_TMP_DIRS);
}
return clonedConfiguration;
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
/**
* Clones the given configuration and resets instance specific config options.
*
* @param configuration to clone
* @return Cloned configuration with reset instance specific config options
*/
public static Configuration cloneConfiguration(Configuration configuration) {
final Configuration clonedConfiguration = new Configuration(configuration);
if (clonedConfiguration.getBoolean(USE_LOCAL_DEFAULT_TMP_DIRS)){
clonedConfiguration.removeConfig(CoreOptions.TMP_DIRS);
clonedConfiguration.removeConfig(USE_LOCAL_DEFAULT_TMP_DIRS);
}
return clonedConfiguration;
}
内容来源于网络,如有侵权,请联系作者删除!