本文整理了Java中org.apache.flink.configuration.Configuration.getLong()
方法的一些代码示例,展示了Configuration.getLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getLong()
方法的具体详情如下:
包路径:org.apache.flink.configuration.Configuration
类名称:Configuration
方法名:getLong
[英]Returns the value associated with the given key as a long.
[中]以长字符串形式返回与给定键关联的值。
代码示例来源:origin: apache/flink
public PythonReceiver(Configuration config, boolean usesByteArray) {
readAsByteArray = usesByteArray;
mappedFileSizeBytes = config.getLong(PythonOptions.MMAP_FILE_SIZE) << 10;
}
代码示例来源:origin: apache/flink
protected PythonSender(Configuration config) {
this.config = config;
mappedFileSizeBytes = config.getLong(PythonOptions.MMAP_FILE_SIZE) << 10;
}
代码示例来源:origin: apache/flink
@Override
public long getLong(String key, long defaultValue) {
return this.backingConfig.getLong(this.prefix + key, defaultValue);
}
代码示例来源:origin: apache/flink
@Override
public long getLong(ConfigOption<Long> configOption, long overrideDefault) {
return this.backingConfig.getLong(configOption, overrideDefault);
}
代码示例来源:origin: apache/flink
public long getBufferTimeout() {
return config.getLong(BUFFER_TIMEOUT, DEFAULT_TIMEOUT);
}
代码示例来源:origin: apache/flink
public long getIterationWaitTime() {
return config.getLong(ITERATON_WAIT, 0);
}
代码示例来源:origin: apache/flink
public long getRefreshInterval() {
return config.getLong(WebOptions.REFRESH_INTERVAL);
}
代码示例来源:origin: apache/flink
/**
* Initialize defaults for input format. Needs to be a static method because it is configured for local
* cluster execution, see LocalFlinkMiniCluster.
* @param configuration The configuration to load defaults from
*/
private static void initDefaultsFromConfiguration(Configuration configuration) {
final long to = configuration.getLong(ConfigConstants.FS_STREAM_OPENING_TIMEOUT_KEY,
ConfigConstants.DEFAULT_FS_STREAM_OPENING_TIMEOUT);
if (to < 0) {
LOG.error("Invalid timeout value for filesystem stream opening: " + to + ". Using default value of " +
ConfigConstants.DEFAULT_FS_STREAM_OPENING_TIMEOUT);
DEFAULT_OPENING_TIMEOUT = ConfigConstants.DEFAULT_FS_STREAM_OPENING_TIMEOUT;
} else if (to == 0) {
DEFAULT_OPENING_TIMEOUT = 300000; // 5 minutes
} else {
DEFAULT_OPENING_TIMEOUT = to;
}
}
代码示例来源:origin: apache/flink
@Override
public void configure(Configuration parameters) {
super.configure(parameters);
// read own parameters
this.blockSize = parameters.getLong(BLOCK_SIZE_PARAMETER_KEY, NATIVE_BLOCK_SIZE);
if (this.blockSize < 1 && this.blockSize != NATIVE_BLOCK_SIZE) {
throw new IllegalArgumentException("The block size parameter must be set and larger than 0.");
}
if (this.blockSize > Integer.MAX_VALUE) {
throw new UnsupportedOperationException("Currently only block size up to Integer.MAX_VALUE are supported");
}
}
代码示例来源:origin: apache/flink
@Override
public long getLong(ConfigOption<Long> configOption) {
return this.backingConfig.getLong(prefixOption(configOption, prefix));
}
代码示例来源:origin: apache/flink
/**
* @return extracted {@link MetricOptions#SYSTEM_RESOURCE_METRICS_PROBING_INTERVAL} or {@code Optional.empty()} if
* {@link MetricOptions#SYSTEM_RESOURCE_METRICS} are disabled.
*/
public static Optional<Time> getSystemResourceMetricsProbingInterval(Configuration configuration) {
if (!configuration.getBoolean(SYSTEM_RESOURCE_METRICS)) {
return Optional.empty();
} else {
return Optional.of(Time.milliseconds(
configuration.getLong(SYSTEM_RESOURCE_METRICS_PROBING_INTERVAL)));
}
}
代码示例来源:origin: apache/flink
public static RestClusterClientConfiguration fromConfiguration(Configuration config) throws ConfigurationException {
RestClientConfiguration restClientConfiguration = RestClientConfiguration.fromConfiguration(config);
final long awaitLeaderTimeout = config.getLong(RestOptions.AWAIT_LEADER_TIMEOUT);
final int retryMaxAttempts = config.getInteger(RestOptions.RETRY_MAX_ATTEMPTS);
final long retryDelay = config.getLong(RestOptions.RETRY_DELAY);
return new RestClusterClientConfiguration(restClientConfiguration, awaitLeaderTimeout, retryMaxAttempts, retryDelay);
}
}
代码示例来源:origin: apache/flink
@Override
public void configure(Configuration parameters) {
super.configure(parameters);
// the if is to prevent the configure() method from
// overwriting the value set by the setter
if (this.blockSize == NATIVE_BLOCK_SIZE) {
long blockSize = parameters.getLong(BLOCK_SIZE_PARAMETER_KEY, NATIVE_BLOCK_SIZE);
setBlockSize(blockSize);
}
}
代码示例来源:origin: apache/flink
private void tryShutdownTimerService() {
if (timerService != null && !timerService.isTerminated()) {
try {
final long timeoutMs = getEnvironment().getTaskManagerInfo().getConfiguration().
getLong(TaskManagerOptions.TASK_CANCELLATION_TIMEOUT_TIMERS);
if (!timerService.shutdownServiceUninterruptible(timeoutMs)) {
LOG.warn("Timer service shutdown exceeded time limit of {} ms while waiting for pending " +
"timers. Will continue with shutdown procedure.", timeoutMs);
}
} catch (Throwable t) {
// catch and log the exception to not replace the original exception
LOG.error("Could not shut down timer service", t);
}
}
}
代码示例来源:origin: apache/flink
processOutput.write((this.function.getRuntimeContext().getIndexOfThisSubtask() + "\n")
.getBytes(ConfigConstants.DEFAULT_CHARSET));
processOutput.write(((config.getLong(PythonOptions.MMAP_FILE_SIZE) << 10) + "\n").getBytes(ConfigConstants.DEFAULT_CHARSET));
processOutput.write((inputFile + "\n").getBytes(ConfigConstants.DEFAULT_CHARSET));
processOutput.write((outputFile + "\n").getBytes(ConfigConstants.DEFAULT_CHARSET));
代码示例来源:origin: apache/flink
public PythonPlanBinder(Configuration globalConfig) {
String configuredPlanTmpPath = globalConfig.getString(PythonOptions.PLAN_TMP_DIR);
tmpPlanFilesDir = configuredPlanTmpPath != null
? configuredPlanTmpPath
: System.getProperty("java.io.tmpdir") + File.separator + "flink_plan_" + UUID.randomUUID();
operatorConfig = new Configuration();
operatorConfig.setString(PythonOptions.PYTHON_BINARY_PATH, globalConfig.getString(PythonOptions.PYTHON_BINARY_PATH));
String configuredTmpDataDir = globalConfig.getString(PythonOptions.DATA_TMP_DIR);
if (configuredTmpDataDir != null) {
operatorConfig.setString(PythonOptions.DATA_TMP_DIR, configuredTmpDataDir);
}
operatorConfig.setLong(PythonOptions.MMAP_FILE_SIZE, globalConfig.getLong(PythonOptions.MMAP_FILE_SIZE));
}
代码示例来源:origin: apache/flink
long maxAlign = taskManagerConfig.getLong(TaskManagerOptions.TASK_CHECKPOINT_ALIGNMENT_BYTES_LIMIT);
if (!(maxAlign == -1 || maxAlign > 0)) {
throw new IllegalConfigurationException(
代码示例来源:origin: apache/flink
Assert.assertEquals(15L, config.getLong("expectedCount", -1L));
代码示例来源:origin: apache/flink
assertEquals("myvalue", copy.getString("mykey", "null"));
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);
代码示例来源:origin: apache/flink
final long latencyTrackingInterval = getExecutionConfig().isLatencyTrackingConfigured()
? getExecutionConfig().getLatencyTrackingInterval()
: configuration.getLong(MetricOptions.LATENCY_INTERVAL);
内容来源于网络,如有侵权,请联系作者删除!