public PythonReceiver(Configuration config, boolean usesByteArray) { readAsByteArray = usesByteArray; mappedFileSizeBytes = config.getLong(PythonOptions.MMAP_FILE_SIZE) << 10; }
protected PythonSender(Configuration config) { this.config = config; mappedFileSizeBytes = config.getLong(PythonOptions.MMAP_FILE_SIZE) << 10; }
@Override public long getLong(String key, long defaultValue) { return this.backingConfig.getLong(this.prefix + key, defaultValue); }
@Override public long getLong(ConfigOption<Long> configOption, long overrideDefault) { return this.backingConfig.getLong(configOption, overrideDefault); }
public long getBufferTimeout() { return config.getLong(BUFFER_TIMEOUT, DEFAULT_TIMEOUT); }
public long getIterationWaitTime() { return config.getLong(ITERATON_WAIT, 0); }
public long getRefreshInterval() { return config.getLong(WebOptions.REFRESH_INTERVAL); }
/** * 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; } }
@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"); } }
@Override public long getLong(ConfigOption<Long> configOption) { return this.backingConfig.getLong(prefixOption(configOption, prefix)); }
/** * @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))); } }
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); } }
@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); } }
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); } } }
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));
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)); }
long maxAlign = taskManagerConfig.getLong(TaskManagerOptions.TASK_CHECKPOINT_ALIGNMENT_BYTES_LIMIT); if (!(maxAlign == -1 || maxAlign > 0)) { throw new IllegalConfigurationException(
Assert.assertEquals(15L, config.getLong("expectedCount", -1L));
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);
final long latencyTrackingInterval = getExecutionConfig().isLatencyTrackingConfigured() ? getExecutionConfig().getLatencyTrackingInterval() : configuration.getLong(MetricOptions.LATENCY_INTERVAL);