@Override public int getInteger(String key, int defaultValue) { return this.backingConfig.getInteger(this.prefix + key, defaultValue); }
public int getWebFrontendPort() { return config.getInteger(WebOptions.PORT); }
public Integer getVertexID() { return config.getInteger(VERTEX_NAME, -1); }
public int getNumberOfOutputs() { return config.getInteger(NUMBER_OF_OUTPUTS, 0); }
@Override public int getInteger(ConfigOption<Integer> configOption, int overrideDefault) { return this.backingConfig.getInteger(configOption, overrideDefault); }
public int getChainIndex() { return this.config.getInteger(CHAIN_INDEX, 0); }
public CheckpointingMode getCheckpointMode() { int ordinal = config.getInteger(CHECKPOINT_MODE, -1); if (ordinal >= 0) { return CheckpointingMode.values()[ordinal]; } else { return DEFAULT_CHECKPOINTING_MODE; } }
@Override public String getClusterDescription() { String host = config.getString(JobManagerOptions.ADDRESS, ""); int port = config.getInteger(JobManagerOptions.PORT, -1); return "Standalone cluster at " + host + ":" + port; }
private static MesosArtifactServer createArtifactServer(Configuration configuration, String hostname) throws Exception { final int artifactServerPort = configuration.getInteger(MesosOptions.ARTIFACT_SERVER_PORT, 0); // a random prefix is affixed to artifact URLs to ensure uniqueness in the Mesos fetcher cache final String artifactServerPrefix = UUID.randomUUID().toString(); return new MesosArtifactServer(artifactServerPrefix, hostname, artifactServerPort, configuration); } }
@Override public int getInteger(ConfigOption<Integer> configOption) { return this.backingConfig.getInteger(prefixOption(configOption, prefix)); }
public TimeCharacteristic getTimeCharacteristic() { int ordinal = config.getInteger(TIME_CHARACTERISTIC, -1); if (ordinal >= 0) { return TimeCharacteristic.values()[ordinal]; } else { throw new CorruptConfigurationException("time characteristic is not set"); } }
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); }
@Override public String getWebInterfaceURL() { final InetSocketAddress inetSocketAddressFromAkkaURL; try { inetSocketAddressFromAkkaURL = AkkaUtils.getInetSocketAddressFromAkkaURL(getClusterConnectionInfo().getAddress()); } catch (Exception e) { throw new RuntimeException("Could not retrieve leader retrieval information.", e); } String host = inetSocketAddressFromAkkaURL.getHostName(); int port = getFlinkConfiguration().getInteger(WebOptions.PORT); return "http://" + host + ":" + port; }
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 public void open(Configuration config) { int val = config.getInteger(TEST_KEY, -1); Assert.assertEquals(TEST_VALUE, val); }
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); } }
protected StreamPlanEnvironment(ExecutionEnvironment env) { super(); this.env = env; int parallelism = env.getParallelism(); if (parallelism > 0) { setParallelism(parallelism); } else { // determine parallelism setParallelism(GlobalConfiguration.loadConfiguration().getInteger(CoreOptions.DEFAULT_PARALLELISM)); } }
public static void checkJobManagerAddress(Configuration config, String expectedAddress, int expectedPort) { String jobManagerAddress = config.getString(JobManagerOptions.ADDRESS); int jobManagerPort = config.getInteger(JobManagerOptions.PORT, -1); assertEquals(expectedAddress, jobManagerAddress); assertEquals(expectedPort, jobManagerPort); }
private void createBroadcastVariable(PythonOperationInfo info) { UdfOperator<?> op1 = (UdfOperator<?>) sets.getDataSet(info.parentID); DataSet<?> op2 = sets.getDataSet(info.otherID); op1.withBroadcastSet(op2, info.name); Configuration c = op1.getParameters(); if (c == null) { c = new Configuration(); } int count = c.getInteger(PLANBINDER_CONFIG_BCVAR_COUNT, 0); c.setInteger(PLANBINDER_CONFIG_BCVAR_COUNT, count + 1); c.setString(PLANBINDER_CONFIG_BCVAR_NAME_PREFIX + count, info.name); op1.withParameters(c); }
public static ClusterSpecification fromConfiguration(Configuration configuration) { int slots = configuration.getInteger(TaskManagerOptions.NUM_TASK_SLOTS, 1); int jobManagerMemoryMb = ConfigurationUtils.getJobManagerHeapMemory(configuration).getMebiBytes(); int taskManagerMemoryMb = ConfigurationUtils.getTaskManagerHeapMemory(configuration).getMebiBytes(); return new ClusterSpecificationBuilder() .setMasterMemoryMB(jobManagerMemoryMb) .setTaskManagerMemoryMB(taskManagerMemoryMb) .setNumberTaskManagers(1) .setSlotsPerTaskManager(slots) .createClusterSpecification(); }