org.apache.flink.configuration.Configuration.getFloat()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.apache.flink.configuration.Configuration.getFloat()方法的一些代码示例,展示了Configuration.getFloat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getFloat()方法的具体详情如下:
包路径:org.apache.flink.configuration.Configuration
类名称:Configuration
方法名:getFloat

Configuration.getFloat介绍

[英]Returns the value associated with the given key as a float.
[中]以浮点形式返回与给定键关联的值。

代码示例

代码示例来源:origin: apache/flink

@Override
public float getFloat(String key, float defaultValue) {
  return this.backingConfig.getFloat(this.prefix + key, defaultValue);
}

代码示例来源:origin: apache/flink

@Override
public float getFloat(ConfigOption<Float> configOption, float overrideDefault) {
  return this.backingConfig.getFloat(configOption, overrideDefault);
}

代码示例来源:origin: apache/flink

@Override
public float getFloat(ConfigOption<Float> configOption) {
  return this.backingConfig.getFloat(prefixOption(configOption, prefix));
}

代码示例来源:origin: apache/flink

public JobGraphGenerator(Configuration config) {
  this.defaultMaxFan = config.getInteger(AlgorithmOptions.SPILLING_MAX_FAN);
  this.defaultSortSpillingThreshold = config.getFloat(AlgorithmOptions.SORT_SPILLING_THRESHOLD);
  this.useLargeRecordHandler = config.getBoolean(
      ConfigConstants.USE_LARGE_RECORD_HANDLER_KEY,
      ConfigConstants.DEFAULT_USE_LARGE_RECORD_HANDLER);
}

代码示例来源:origin: apache/flink

/**
 * See documentation.
 */
public static int calculateHeapSize(int memory, org.apache.flink.configuration.Configuration conf) {
  float memoryCutoffRatio = conf.getFloat(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO);
  int minCutoff = conf.getInteger(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_MIN);
  if (memoryCutoffRatio > 1 || memoryCutoffRatio < 0) {
    throw new IllegalArgumentException("The configuration value '"
      + ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO.key()
      + "' must be between 0 and 1. Value given=" + memoryCutoffRatio);
  }
  if (minCutoff > memory) {
    throw new IllegalArgumentException("The configuration value '"
      + ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_MIN.key()
      + "' is higher (" + minCutoff + ") than the requested amount of memory " + memory);
  }
  int heapLimit = (int) ((float) memory * memoryCutoffRatio);
  if (heapLimit < minCutoff) {
    heapLimit = minCutoff;
  }
  return memory - heapLimit;
}

代码示例来源:origin: apache/flink

assertEquals(100, copy.getInteger("mynumber", 0));
assertEquals(478236947162389746L, copy.getLong("longvalue", 0L));
assertEquals(3.1415926f, copy.getFloat("PI", 3.1415926f), 0.0);
assertEquals(Math.E, copy.getDouble("E", 0.0), 0.0);
assertEquals(true, copy.getBoolean("shouldbetrue", false));

代码示例来源:origin: apache/flink

assertEquals(5f, pc.getFloat("int", 0), 0.0);
assertEquals(5.0, pc.getDouble("int", 0), 0.0);
assertEquals(false, pc.getBoolean("int", true));
assertEquals(15f, pc.getFloat("long", 0), 0.0);
assertEquals(15.0, pc.getDouble("long", 0), 0.0);
assertEquals(false, pc.getBoolean("long", true));
assertEquals((float) TOO_LONG, pc.getFloat("too_long", 0), 10.0);
assertEquals((double) TOO_LONG, pc.getDouble("too_long", 0), 10.0);
assertEquals(false, pc.getBoolean("too_long", true));
assertEquals(2.1456775f, pc.getFloat("float", 0), 0.0);
assertEquals(2.1456775, pc.getDouble("float", 0), 0.0000001);
assertEquals(false, pc.getBoolean("float", true));
assertEquals(3.141592f, pc.getFloat("double", 0), 0.000001);
assertEquals(Math.PI, pc.getDouble("double", 0), 0.0);
assertEquals(false, pc.getBoolean("double", true));
assertEquals(-1f, pc.getFloat("negative_double", 0), 0.000001);
assertEquals(-1, pc.getDouble("negative_double", 0), 0.0);
assertEquals(false, pc.getBoolean("negative_double", true));
assertEquals(0f, pc.getFloat("zero", -1), 0.000001);
assertEquals(0.0, pc.getDouble("zero", -1), 0.0);
assertEquals(false, pc.getBoolean("zero", true));
assertEquals(0f, pc.getFloat("too_long_double", 0f), 0.000001);

代码示例来源:origin: org.apache.flink/flink-core

@Override
public float getFloat(ConfigOption<Float> configOption, float overrideDefault) {
  return this.backingConfig.getFloat(configOption, overrideDefault);
}

代码示例来源:origin: org.apache.flink/flink-core

@Override
public float getFloat(String key, float defaultValue) {
  return this.backingConfig.getFloat(this.prefix + key, defaultValue);
}

代码示例来源:origin: org.apache.flink/flink-runtime

public float getSpillingThresholdDriver() {
  return this.config.getFloat(SORT_SPILLING_THRESHOLD_DRIVER, 0.7f);
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

public float getSpillingThresholdDriver() {
  return this.config.getFloat(SORT_SPILLING_THRESHOLD_DRIVER, 0.7f);
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

public float getSpillingThresholdDriver() {
  return this.config.getFloat(SORT_SPILLING_THRESHOLD_DRIVER, 0.7f);
}

代码示例来源:origin: org.apache.flink/flink-runtime

public float getSpillingThresholdInput(int inputNum) {
  return this.config.getFloat(SORT_SPILLING_THRESHOLD_INPUT_PREFIX + inputNum, 0.7f);
}

代码示例来源:origin: com.alibaba.blink/flink-core

@Override
public float getFloat(String key, float defaultValue) {
  return this.backingConfig.getFloat(this.prefix + key, defaultValue);
}

代码示例来源:origin: com.alibaba.blink/flink-core

@Override
public float getFloat(ConfigOption<Float> configOption) {
  return this.backingConfig.getFloat(prefixOption(configOption, prefix));
}

代码示例来源:origin: org.apache.flink/flink-core

@Override
public float getFloat(ConfigOption<Float> configOption) {
  return this.backingConfig.getFloat(prefixOption(configOption, prefix));
}

代码示例来源:origin: com.alibaba.blink/flink-optimizer

public JobGraphGenerator(Configuration config) {
  this.defaultMaxFan = config.getInteger(AlgorithmOptions.SPILLING_MAX_FAN);
  this.defaultSortSpillingThreshold = config.getFloat(AlgorithmOptions.SORT_SPILLING_THRESHOLD);
  this.useLargeRecordHandler = config.getBoolean(
      ConfigConstants.USE_LARGE_RECORD_HANDLER_KEY,
      ConfigConstants.DEFAULT_USE_LARGE_RECORD_HANDLER);
}

代码示例来源:origin: org.apache.flink/flink-optimizer

public JobGraphGenerator(Configuration config) {
  this.defaultMaxFan = config.getInteger(AlgorithmOptions.SPILLING_MAX_FAN);
  this.defaultSortSpillingThreshold = config.getFloat(AlgorithmOptions.SORT_SPILLING_THRESHOLD);
  this.useLargeRecordHandler = config.getBoolean(
      ConfigConstants.USE_LARGE_RECORD_HANDLER_KEY,
      ConfigConstants.DEFAULT_USE_LARGE_RECORD_HANDLER);
}

代码示例来源:origin: org.apache.flink/flink-optimizer_2.11

public JobGraphGenerator(Configuration config) {
  this.defaultMaxFan = config.getInteger(AlgorithmOptions.SPILLING_MAX_FAN);
  this.defaultSortSpillingThreshold = config.getFloat(AlgorithmOptions.SORT_SPILLING_THRESHOLD);
  this.useLargeRecordHandler = config.getBoolean(
      ConfigConstants.USE_LARGE_RECORD_HANDLER_KEY,
      ConfigConstants.DEFAULT_USE_LARGE_RECORD_HANDLER);
}

代码示例来源:origin: org.apache.flink/flink-optimizer_2.10

public JobGraphGenerator(Configuration config) {
  this.defaultMaxFan = config.getInteger(ConfigConstants.DEFAULT_SPILLING_MAX_FAN_KEY, 
    ConfigConstants.DEFAULT_SPILLING_MAX_FAN);
  this.defaultSortSpillingThreshold = config.getFloat(ConfigConstants.DEFAULT_SORT_SPILLING_THRESHOLD_KEY,
    ConfigConstants.DEFAULT_SORT_SPILLING_THRESHOLD);
  this.useLargeRecordHandler = config.getBoolean(
      ConfigConstants.USE_LARGE_RECORD_HANDLER_KEY,
      ConfigConstants.DEFAULT_USE_LARGE_RECORD_HANDLER);
}

相关文章