/** * Initialize MQTT parameters * * @param config Redis Configuration */ void initParams(AbstractConfiguration config) { this.inFlightQueueSize = config.getInt("mqtt.inflight.queue.size", 0); this.qos2QueueSize = config.getInt("mqtt.qos2.queue.size", 0); this.retainQueueSize = config.getInt("mqtt.retain.queue.size", 0); }
@Override public int listenPort() { return ConfigurationManager.getConfigInstance().getInt(CONTAINER_LISTEN_PORT, LISTEN_PORT_DEFAULT); }
final int maxRunningJobs = CONF.getInt( "com.netflix.genie.server.max.running.jobs", 0); final int jobForwardThreshold = CONF.getInt( "com.netflix.genie.server.forward.jobs.threshold", 0); final int maxIdleHostThreshold = CONF.getInt( "com.netflix.genie.server.max.idle.host.threshold", 0); final int idleHostThresholdDelta = CONF.getInt( "com.netflix.genie.server.idle.host.threshold.delta", 0);
@Override public void init(AbstractConfiguration config) { if (!config.getString("redis.type").equals("single")) { throw new IllegalStateException("RedisSyncSingleStorageImpl class can only be used with single redis setup, but redis.type value is " + config.getString("redis.type")); } List<String> address = parseRedisAddress(config.getString("redis.address"), 6379); int databaseNumber = config.getInt("redis.database", 0); String password = StringUtils.isNotEmpty(config.getString("redis.password")) ? config.getString("redis.password") + "@" : ""; // lettuce RedisURI lettuceURI = RedisURI.create("redis://" + password + address.get(0) + "/" + databaseNumber); this.lettuce = RedisClient.create(lettuceURI); this.lettuceConn = this.lettuce.connect(); // params initParams(config); }
/** * {@inheritDoc} */ @Override public void launch() throws GenieException { LOG.info("called"); if (!this.isInitCalled()) { throw new GeniePreconditionException("Init wasn't called. Unable to continue."); } // create the ProcessBuilder for this process final List<String> processArgs = this.createBaseProcessArguments(); processArgs.addAll(Arrays.asList(StringUtil.splitCmdLine(this.getJob().getCommandArgs()))); final ProcessBuilder processBuilder = new ProcessBuilder(processArgs); // construct the environment variables this.setupCommonProcess(processBuilder); this.setupYarnProcess(processBuilder); // Launch the actual process this.launchProcess( processBuilder, ConfigurationManager .getConfigInstance() .getInt("com.netflix.genie.server.job.manager.yarn.sleeptime", 5000) ); }
@Override public void init(AbstractConfiguration config) { if (!config.getString("redis.type").equals("master_slave")) { throw new IllegalStateException("RedisSyncSingleStorageImpl class can only be used with master slave redis setup, but redis.type value is " + config.getString("redis.type")); } List<String> address = parseRedisAddress(config.getString("redis.address"), 6379); int databaseNumber = config.getInt("redis.database", 0); String password = StringUtils.isNotEmpty(config.getString("redis.password")) ? config.getString("redis.password") + "@" : ""; // lettuce RedisURI lettuceURI = RedisURI.create("redis://" + password + address.get(0) + "/" + databaseNumber); this.lettuceMasterSlave = RedisClient.create(lettuceURI); this.lettuceMasterSlaveConn = MasterSlave.connect(this.lettuceMasterSlave, new Utf8StringCodec(), lettuceURI); this.lettuceMasterSlaveConn.setReadFrom(ReadFrom.valueOf(config.getString("redis.read"))); // params initParams(config); }
ConfigurationManager .getConfigInstance() .getInt("com.netflix.genie.server.job.manager.presto.sleeptime", 5000) );
@Override public void init(AbstractConfiguration config) { if (!config.getString("redis.type").equals("sentinel")) { throw new IllegalStateException("RedisSyncSingleStorageImpl class can only be used with sentinel redis setup, but redis.type value is " + config.getString("redis.type")); } List<String> address = parseRedisAddress(config.getString("redis.address"), 26379); int databaseNumber = config.getInt("redis.database", 0); String password = StringUtils.isNotEmpty(config.getString("redis.password")) ? config.getString("redis.password") + "@" : ""; String masterId = config.getString("redis.master"); // lettuce RedisURI lettuceURI = RedisURI.create("redis-sentinel://" + password + String.join(",", address) + "/" + databaseNumber + "#" + masterId); this.lettuceSentinel = RedisClient.create(lettuceURI); this.lettuceSentinelConn = MasterSlave.connect(this.lettuceSentinel, new Utf8StringCodec(), lettuceURI); this.lettuceSentinelConn.setReadFrom(ReadFrom.valueOf(config.getString("redis.read"))); // params initParams(config); }
cf.setMaxReconnect(config.getInt("nats.maxReconnect", DEFAULT_MAX_RECONNECT)); cf.setReconnectWait(config.getInt("nats.reconnectWait", DEFAULT_RECONNECT_WAIT)); cf.setReconnectBufSize(config.getInt("nats.reconnectBufSize", DEFAULT_RECONNECT_BUF_SIZE)); cf.setConnectionTimeout(config.getInt("nats.connectionTimeout", DEFAULT_TIMEOUT)); cf.setPingInterval(config.getInt("nats.pingInterval", DEFAULT_PING_INTERVAL)); cf.setMaxPingsOut(config.getInt("nats.maxPingsOut", DEFAULT_MAX_PINGS_OUT)); cf.setMaxPendingMsgs(config.getInt("nats.maxPendingMsgs", DEFAULT_MAX_PENDING_MSGS)); cf.setMaxPendingBytes(config.getInt("nats.maxPendingBytes", DEFAULT_MAX_PENDING_BYTES));
@Override protected AbstractConfiguration getConfiguration() { AbstractConfiguration config = ConfigurationManager.getConfigInstance(); boolean dynamic = config.getBoolean(DYNAMIC_CONFIG, true); if (!dynamic) { return new DynamicConfiguration(); } else { String appId = null; DeploymentContext context = ConfigurationManager.getDeploymentContext(); appId = context.getApplicationId(); if (appId == null) { throw new RuntimeException( "Archaius deployment context's applicationId not set (archaius.deployment.applicationId)"); } String consulHost = config.getString(CONSUL_HOST, CONSUL_DEFAULT_HOST); int consulPort = config.getInt(CONSUL_PORT, 8500); String consulAclToken = config.getString(CONSUL_TOKEN); ConsulWatchedConfigurationSource configSource = new ConsulWatchedConfigurationSource(appId, new ConsulClient(consulHost, consulPort), 30, TimeUnit.SECONDS, consulAclToken); // do the first update synchronously try { configSource.runOnce(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } configSource.startAsync(); return new DynamicWatchedConfiguration(configSource); } }
@Override public void init(AbstractConfiguration config) { if (!config.getString("redis.type").equals("cluster")) { throw new IllegalStateException("RedisSyncSingleStorageImpl class can only be used with cluster redis setup, but redis.type value is " + config.getString("redis.type")); } List<String> address = parseRedisAddress(config.getString("redis.address"), 6379); int databaseNumber = config.getInt("redis.database", 0); String password = StringUtils.isNotEmpty(config.getString("redis.password")) ? config.getString("redis.password") + "@" : ""; // lettuce RedisURI lettuceURI = RedisURI.create("redis://" + password + address.get(0) + "/" + databaseNumber); this.lettuceCluster = RedisClusterClient.create(lettuceURI); this.lettuceCluster.setOptions(ClusterClientOptions.builder() .topologyRefreshOptions(ClusterTopologyRefreshOptions.builder() .enablePeriodicRefresh(config.getBoolean("redis.cluster.periodicRefreshEnabled", ClusterTopologyRefreshOptions.DEFAULT_PERIODIC_REFRESH_ENABLED)) .refreshPeriod(config.getLong("redis.cluster.refreshPeriod", ClusterTopologyRefreshOptions.DEFAULT_REFRESH_PERIOD), TimeUnit.SECONDS) .closeStaleConnections(config.getBoolean("redis.cluster.closeStaleConnections", ClusterTopologyRefreshOptions.DEFAULT_CLOSE_STALE_CONNECTIONS)) .build()) .validateClusterNodeMembership(config.getBoolean("redis.cluster.validateClusterNodeMembership", ClusterClientOptions.DEFAULT_VALIDATE_CLUSTER_MEMBERSHIP)) .maxRedirects(config.getInt("redis.cluster.refreshPeriod", ClusterClientOptions.DEFAULT_MAX_REDIRECTS)) .build()); this.lettuceClusterConn = this.lettuceCluster.connect(); this.lettuceClusterConn.setReadFrom(ReadFrom.valueOf(config.getString("redis.read"))); // params initParams(config); }
if (!disableEureka) { int httpPort = ConfigurationManager.getConfigInstance().getInt("http.port",-1); int httpsPort = ConfigurationManager.getConfigInstance().getInt("https.port",-1); int eurekaPort = ConfigurationManager.getConfigInstance().getInt("eureka.port",-1); int eurekaSecurePort = ConfigurationManager.getConfigInstance().getInt("eureka.securePort",-1); boolean httpPortEnabled = ConfigurationManager.getConfigInstance().getBoolean("http.enabled", false); boolean httpsPortEnabled = ConfigurationManager.getConfigInstance().getBoolean("https.enabled", false);