本文整理了Java中org.apache.flink.configuration.Configuration.getBoolean()
方法的一些代码示例,展示了Configuration.getBoolean()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getBoolean()
方法的具体详情如下:
包路径:org.apache.flink.configuration.Configuration
类名称:Configuration
方法名:getBoolean
[英]Returns the value associated with the given key as a boolean.
[中]以布尔形式返回与给定键关联的值。
代码示例来源:origin: apache/flink
@Override
public boolean getBoolean(String key, boolean defaultValue) {
return this.backingConfig.getBoolean(this.prefix + key, defaultValue);
}
代码示例来源:origin: apache/flink
@Override
public boolean getBoolean(ConfigOption<Boolean> configOption, boolean overrideDefault) {
return this.backingConfig.getBoolean(configOption, overrideDefault);
}
代码示例来源:origin: apache/flink
/**
* 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;
}
代码示例来源:origin: apache/flink
public boolean isCheckpointingEnabled() {
return config.getBoolean(CHECKPOINTING_ENABLED, false);
}
代码示例来源:origin: apache/flink
public boolean isChainEnd() {
return config.getBoolean(CHAIN_END, false);
}
代码示例来源:origin: apache/flink
public boolean isChainStart() {
return config.getBoolean(IS_CHAINED_VERTEX, false);
}
代码示例来源:origin: apache/flink
public boolean isProgramSubmitEnabled() {
return config.getBoolean(WebOptions.SUBMIT_ENABLE);
}
代码示例来源:origin: apache/flink
@Override
public boolean getBoolean(ConfigOption<Boolean> configOption) {
return this.backingConfig.getBoolean(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 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
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();
}
代码示例来源:origin: apache/flink
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();
代码示例来源:origin: apache/flink
/**
* 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);
}
}
代码示例来源:origin: apache/flink
final boolean enableSSL = config.getBoolean(
MesosOptions.ARTIFACT_SERVER_SSL_ENABLED) &&
SSLUtils.isRestSSLEnabled(config);
代码示例来源:origin: apache/flink
config.getBoolean(CheckpointingOptions.INCREMENTAL_CHECKPOINTS));
代码示例来源:origin: apache/flink
if (config.getBoolean(HistoryServerOptions.HISTORY_SERVER_WEB_SSL_ENABLED) && SSLUtils.isRestSSLEnabled(config)) {
LOG.info("Enabling SSL for the history server.");
try {
代码示例来源:origin: apache/flink
if (taskManagerConfig.getBoolean(TaskManagerOptions.NETWORK_CREDIT_MODEL)) {
barrierHandler = new BarrierBuffer(inputGate, new CachedBufferBlocker(inputGate.getPageSize()), maxAlign);
} else {
代码示例来源:origin: apache/flink
@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();
}
}
}
代码示例来源:origin: apache/flink
@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();
}
}
}
代码示例来源:origin: apache/flink
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()));
内容来源于网络,如有侵权,请联系作者删除!