@Override public boolean getBoolean(String key, boolean defaultValue) { return this.backingConfig.getBoolean(this.prefix + key, defaultValue); }
@Override public boolean getBoolean(ConfigOption<Boolean> configOption, boolean overrideDefault) { return this.backingConfig.getBoolean(configOption, overrideDefault); }
/** * Initialize defaults for output 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 */ public static void initDefaultsFromConfiguration(Configuration configuration) { final boolean overwrite = configuration.getBoolean(CoreOptions.FILESYTEM_DEFAULT_OVERRIDE); DEFAULT_WRITE_MODE = overwrite ? WriteMode.OVERWRITE : WriteMode.NO_OVERWRITE; final boolean alwaysCreateDirectory = configuration.getBoolean(CoreOptions.FILESYSTEM_OUTPUT_ALWAYS_CREATE_DIRECTORY); DEFAULT_OUTPUT_DIRECTORY_MODE = alwaysCreateDirectory ? OutputDirectoryMode.ALWAYS : OutputDirectoryMode.PARONLY; }
public boolean isCheckpointingEnabled() { return config.getBoolean(CHECKPOINTING_ENABLED, false); }
public boolean isChainEnd() { return config.getBoolean(CHAIN_END, false); }
public boolean isChainStart() { return config.getBoolean(IS_CHAINED_VERTEX, false); }
public boolean isProgramSubmitEnabled() { return config.getBoolean(WebOptions.SUBMIT_ENABLE); }
@Override public boolean getBoolean(ConfigOption<Boolean> configOption) { return this.backingConfig.getBoolean(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 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); }
public static Set<Entry<String, DistributedCacheEntry>> readFileInfoFromConfig(Configuration conf) { int num = conf.getInteger(CACHE_FILE_NUM, 0); if (num == 0) { return Collections.emptySet(); } Map<String, DistributedCacheEntry> cacheFiles = new HashMap<String, DistributedCacheEntry>(); for (int i = 1; i <= num; i++) { String name = conf.getString(CACHE_FILE_NAME + i, null); String filePath = conf.getString(CACHE_FILE_PATH + i, null); boolean isExecutable = conf.getBoolean(CACHE_FILE_EXE + i, false); boolean isDirectory = conf.getBoolean(CACHE_FILE_DIR + i, false); byte[] blobKey = conf.getBytes(CACHE_FILE_BLOB_KEY + i, null); cacheFiles.put(name, new DistributedCacheEntry(filePath, isExecutable, blobKey, isDirectory)); } return cacheFiles.entrySet(); }
if (config.getBoolean(MONITOR_NUM_IMMUTABLE_MEM_TABLES)) { options.enableNumImmutableMemTable(); if (config.getBoolean(MONITOR_MEM_TABLE_FLUSH_PENDING)) { options.enableMemTableFlushPending(); if (config.getBoolean(TRACK_COMPACTION_PENDING)) { options.enableCompactionPending(); if (config.getBoolean(MONITOR_BACKGROUND_ERRORS)) { options.enableBackgroundErrors(); if (config.getBoolean(MONITOR_CUR_SIZE_ACTIVE_MEM_TABLE)) { options.enableCurSizeActiveMemTable(); if (config.getBoolean(MONITOR_CUR_SIZE_ALL_MEM_TABLE)) { options.enableCurSizeAllMemTables(); if (config.getBoolean(MONITOR_SIZE_ALL_MEM_TABLES)) { options.enableSizeAllMemTables(); if (config.getBoolean(MONITOR_NUM_ENTRIES_ACTIVE_MEM_TABLE)) { options.enableNumEntriesActiveMemTable(); if (config.getBoolean(MONITOR_NUM_ENTRIES_IMM_MEM_TABLES)) { options.enableNumEntriesImmMemTables(); if (config.getBoolean(MONITOR_NUM_DELETES_ACTIVE_MEM_TABLE)) { options.enableNumDeletesActiveMemTable();
/** * Configures the file input format by reading the file path from the configuration. * * @see org.apache.flink.api.common.io.InputFormat#configure(org.apache.flink.configuration.Configuration) */ @Override public void configure(Configuration parameters) { if (getFilePaths().length == 0) { // file path was not specified yet. Try to set it from the parameters. String filePath = parameters.getString(FILE_PARAMETER_KEY, null); if (filePath == null) { throw new IllegalArgumentException("File path was not specified in input format or configuration."); } else { setFilePath(filePath); } } if (!this.enumerateNestedFiles) { this.enumerateNestedFiles = parameters.getBoolean(ENUMERATE_NESTED_FILES_FLAG, false); } }
final boolean enableSSL = config.getBoolean( MesosOptions.ARTIFACT_SERVER_SSL_ENABLED) && SSLUtils.isRestSSLEnabled(config);
config.getBoolean(CheckpointingOptions.INCREMENTAL_CHECKPOINTS));
if (config.getBoolean(HistoryServerOptions.HISTORY_SERVER_WEB_SSL_ENABLED) && SSLUtils.isRestSSLEnabled(config)) { LOG.info("Enabling SSL for the history server."); try {
if (taskManagerConfig.getBoolean(TaskManagerOptions.NETWORK_CREDIT_MODEL)) { barrierHandler = new BarrierBuffer(inputGate, new CachedBufferBlocker(inputGate.getPageSize()), maxAlign); } else {
@Override public void invoke() throws Exception { RecordReader<SpeedTestRecord> reader = new RecordReader<>( getEnvironment().getInputGate(0), SpeedTestRecord.class, getEnvironment().getTaskManagerInfo().getTmpDirectories()); try { boolean isSlow = getTaskConfiguration().getBoolean(IS_SLOW_RECEIVER_CONFIG_KEY, false); int numRecords = 0; while (reader.next() != null) { if (isSlow && (numRecords++ % IS_SLOW_EVERY_NUM_RECORDS) == 0) { Thread.sleep(IS_SLOW_SLEEP_MS); } } } finally { reader.clearBuffers(); } } }
@Override public void invoke() throws Exception { RecordWriter<SpeedTestRecord> writer = new RecordWriter<>(getEnvironment().getWriter(0)); try { // Determine the amount of data to send per subtask int dataVolumeGb = getTaskConfiguration().getInteger(NetworkStackThroughputITCase.DATA_VOLUME_GB_CONFIG_KEY, 1); long dataMbPerSubtask = (dataVolumeGb * 10) / getCurrentNumberOfSubtasks(); long numRecordsToEmit = (dataMbPerSubtask * 1024 * 1024) / SpeedTestRecord.RECORD_SIZE; LOG.info(String.format("%d/%d: Producing %d records (each record: %d bytes, total: %.2f GB)", getIndexInSubtaskGroup() + 1, getCurrentNumberOfSubtasks(), numRecordsToEmit, SpeedTestRecord.RECORD_SIZE, dataMbPerSubtask / 1024.0)); boolean isSlow = getTaskConfiguration().getBoolean(IS_SLOW_SENDER_CONFIG_KEY, false); int numRecords = 0; SpeedTestRecord record = new SpeedTestRecord(); for (long i = 0; i < numRecordsToEmit; i++) { if (isSlow && (numRecords++ % IS_SLOW_EVERY_NUM_RECORDS) == 0) { Thread.sleep(IS_SLOW_SLEEP_MS); } writer.emit(record); } } finally { writer.clearBuffers(); writer.flushAll(); } } }
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)); assertArrayEquals(new byte[] { 1, 2, 3, 4, 5 }, copy.getBytes("bytes sequence", null)); assertEquals(getClass(), copy.getClass("myclass", null, getClass().getClassLoader()));