@Override public void setBoolean(String key, boolean value) { this.backingConfig.setBoolean(this.prefix + key, value); }
public void setChainEnd() { config.setBoolean(CHAIN_END, true); }
public void setCheckpointingEnabled(boolean enabled) { config.setBoolean(CHECKPOINTING_ENABLED, enabled); }
/** * Sets a stub parameters in the configuration of this contract. The stub parameters are accessible by the user * code at runtime. Parameters that the user code needs to access at runtime to configure its behavior are * typically stored as stub parameters. * * @see #getParameters() * @param key * The parameter key. * @param value * The parameter value. */ public void setParameter(String key, boolean value) { this.parameters.setBoolean(key, value); }
public void setChainStart() { config.setBoolean(IS_CHAINED_VERTEX, true); }
@Override public void setBoolean(ConfigOption<Boolean> key, boolean value) { this.backingConfig.setBoolean(prefix + key.key(), value); }
public static void writeFileInfoToConfig(String name, DistributedCacheEntry e, Configuration conf) { int num = conf.getInteger(CACHE_FILE_NUM, 0) + 1; conf.setInteger(CACHE_FILE_NUM, num); conf.setString(CACHE_FILE_NAME + num, name); conf.setString(CACHE_FILE_PATH + num, e.filePath); conf.setBoolean(CACHE_FILE_EXE + num, e.isExecutable || new File(e.filePath).canExecute()); conf.setBoolean(CACHE_FILE_DIR + num, e.isZipped || new File(e.filePath).isDirectory()); if (e.blobKey != null) { conf.setBytes(CACHE_FILE_BLOB_KEY + num, e.blobKey); } }
@Override protected Configuration createClusterConfig() throws IOException { Configuration config = super.createClusterConfig(); config.setBoolean( CheckpointingOptions.LOCAL_RECOVERY, localRecoveryEnabled); return config; } };
private Configuration createConfiguration() { Configuration newConfiguration = new Configuration(); newConfiguration.setInteger(TaskManagerOptions.NUM_TASK_SLOTS, getTaskManagerNumSlots()); newConfiguration.setBoolean(CoreOptions.FILESYTEM_DEFAULT_OVERRIDE, isDefaultOverwriteFiles()); newConfiguration.addAll(baseConfiguration); return newConfiguration; }
private static Configuration getClusterConfiguration() { Configuration config = new Configuration(); try { File logDir = File.createTempFile("TestBaseUtils-logdir", null); assertTrue("Unable to delete temp file", logDir.delete()); assertTrue("Unable to create temp directory", logDir.mkdir()); File logFile = new File(logDir, "jobmanager.log"); File outFile = new File(logDir, "jobmanager.out"); Files.createFile(logFile.toPath()); Files.createFile(outFile.toPath()); config.setString(WebOptions.LOG_PATH, logFile.getAbsolutePath()); config.setString(ConfigConstants.TASK_MANAGER_LOG_PATH_KEY, logFile.getAbsolutePath()); } catch (Exception e) { throw new AssertionError("Could not setup test.", e); } config.setString(TaskManagerOptions.MANAGED_MEMORY_SIZE, "12m"); config.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true); return config; }
private static Configuration getConfiguration() { Configuration configuration = new Configuration(); configuration.setBoolean(SYSTEM_RESOURCE_METRICS, true); configuration.setString(REPORTERS_LIST, "test_reporter"); configuration.setString("metrics.reporter.test_reporter.class", TestReporter.class.getName()); return configuration; }
/** * Tests that if local recovery is disabled we won't spread * out tasks when recovering. */ @Test public void testDisablingLocalRecovery() throws Exception { final Configuration configuration = new Configuration(); configuration.setBoolean(CheckpointingOptions.LOCAL_RECOVERY, false); executeSchedulingTest(configuration); }
/** * Creates a {@link LocalStreamEnvironment} for local program execution that also starts the * web monitoring UI. * * <p>The local execution environment will run the program in a multi-threaded fashion in * the same JVM as the environment was created in. It will use the parallelism specified in the * parameter. * * <p>If the configuration key 'rest.port' was set in the configuration, that particular * port will be used for the web UI. Otherwise, the default port (8081) will be used. */ @PublicEvolving public static StreamExecutionEnvironment createLocalEnvironmentWithWebUI(Configuration conf) { checkNotNull(conf, "conf"); conf.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true); if (!conf.contains(RestOptions.PORT)) { // explicitly set this option so that it's not set to 0 later conf.setInteger(RestOptions.PORT, RestOptions.PORT.defaultValue()); } return createLocalEnvironment(defaultLocalParallelism, conf); }
/** * Creates a {@link LocalEnvironment} for local program execution that also starts the * web monitoring UI. * * <p>The local execution environment will run the program in a multi-threaded fashion in * the same JVM as the environment was created in. It will use the parallelism specified in the * parameter. * * <p>If the configuration key 'rest.port' was set in the configuration, that particular * port will be used for the web UI. Otherwise, the default port (8081) will be used. */ @PublicEvolving public static ExecutionEnvironment createLocalEnvironmentWithWebUI(Configuration conf) { checkNotNull(conf, "conf"); conf.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true); if (!conf.contains(RestOptions.PORT)) { // explicitly set this option so that it's not set to 0 later conf.setInteger(RestOptions.PORT, RestOptions.PORT.defaultValue()); } return createLocalEnvironment(conf, -1); }
private void testLocalRecoveryInternal(String failoverStrategyValue) throws Exception { final Configuration configuration = new Configuration(); configuration.setBoolean(CheckpointingOptions.LOCAL_RECOVERY, true); configuration.setString(EXECUTION_FAILOVER_STRATEGY.key(), failoverStrategyValue); executeSchedulingTest(configuration); }
/** * Test with one nested directory and recursive.file.enumeration = true */ @Test public void testOneNestedDirectoryTrue() { try { String firstLevelDir = TestFileUtils.randomFileName(); String secondLevelDir = TestFileUtils.randomFileName(); File insideNestedDir = tempFolder.newFolder(firstLevelDir, secondLevelDir); File nestedDir = insideNestedDir.getParentFile(); // create a file in the first-level and two files in the nested dir TestFileUtils.createTempFileInDirectory(nestedDir.getAbsolutePath(), "paella"); TestFileUtils.createTempFileInDirectory(insideNestedDir.getAbsolutePath(), "kalamari"); TestFileUtils.createTempFileInDirectory(insideNestedDir.getAbsolutePath(), "fideua"); this.format.setFilePath(new Path(nestedDir.toURI().toString())); this.config.setBoolean("recursive.file.enumeration", true); format.configure(this.config); FileInputSplit[] splits = format.createInputSplits(1); Assert.assertEquals(3, splits.length); } catch (Exception ex) { ex.printStackTrace(); Assert.fail(ex.getMessage()); } }
/** * Test without nested directory and recursive.file.enumeration = true */ @Test public void testNoNestedDirectoryTrue() { try { String filePath = TestFileUtils.createTempFile("foo"); this.format.setFilePath(new Path(filePath)); this.config.setBoolean("recursive.file.enumeration", true); format.configure(this.config); FileInputSplit[] splits = format.createInputSplits(1); Assert.assertEquals(1, splits.length); } catch (Exception ex) { ex.printStackTrace(); Assert.fail(ex.getMessage()); } }
private static Configuration getConfig() { Configuration config = new Configuration(); config.setBoolean(QueryableStateOptions.ENABLE_QUERYABLE_STATE_PROXY_SERVER, true); config.setString(TaskManagerOptions.MANAGED_MEMORY_SIZE, "4m"); config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, NUM_TMS); config.setInteger(TaskManagerOptions.NUM_TASK_SLOTS, NUM_SLOTS_PER_TM); config.setInteger(QueryableStateOptions.CLIENT_NETWORK_THREADS, 1); config.setInteger(QueryableStateOptions.PROXY_NETWORK_THREADS, 1); config.setInteger(QueryableStateOptions.SERVER_NETWORK_THREADS, 1); config.setString( QueryableStateOptions.PROXY_PORT_RANGE, QS_PROXY_PORT_RANGE_START + "-" + (QS_PROXY_PORT_RANGE_START + NUM_TMS)); config.setString( QueryableStateOptions.SERVER_PORT_RANGE, QS_SERVER_PORT_RANGE_START + "-" + (QS_SERVER_PORT_RANGE_START + NUM_TMS)); config.setBoolean(WebOptions.SUBMIT_ENABLE, false); return config; }
private static Configuration getConfiguration() { verifyJvmOptions(); Configuration config = new Configuration(); config.setBoolean(CoreOptions.FILESYTEM_DEFAULT_OVERRIDE, true); config.setString(AkkaOptions.ASK_TIMEOUT, TestingUtils.DEFAULT_AKKA_ASK_TIMEOUT()); config.setString(TaskManagerOptions.MEMORY_SEGMENT_SIZE, "4096"); config.setInteger(TaskManagerOptions.NETWORK_NUM_BUFFERS, 2048); return config; }
private static Configuration getConfig() { Configuration config = new Configuration(); config.setBoolean(QueryableStateOptions.ENABLE_QUERYABLE_STATE_PROXY_SERVER, true); config.setString(TaskManagerOptions.MANAGED_MEMORY_SIZE, "4m"); config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, NUM_TMS); config.setInteger(TaskManagerOptions.NUM_TASK_SLOTS, NUM_SLOTS_PER_TM); config.setInteger(QueryableStateOptions.CLIENT_NETWORK_THREADS, 1); config.setInteger(QueryableStateOptions.PROXY_NETWORK_THREADS, 1); config.setInteger(QueryableStateOptions.SERVER_NETWORK_THREADS, 1); config.setString( QueryableStateOptions.PROXY_PORT_RANGE, QS_PROXY_PORT_RANGE_START + "-" + (QS_PROXY_PORT_RANGE_START + NUM_PORT_COUNT)); config.setString( QueryableStateOptions.SERVER_PORT_RANGE, QS_SERVER_PORT_RANGE_START + "-" + (QS_SERVER_PORT_RANGE_START + NUM_PORT_COUNT)); config.setBoolean(WebOptions.SUBMIT_ENABLE, false); return config; } }