List of usage examples for org.apache.commons.configuration Configuration getInt
int getInt(String key, int defaultValue);
From source file:com.linkedin.pinot.broker.routing.builder.BalancedRandomRoutingTableBuilder.java
@Override public void init(Configuration configuration, TableConfig tableConfig, ZkHelixPropertyStore<ZNRecord> propertyStore) { _numRoutingTables = configuration.getInt(NUM_ROUTING_TABLES_KEY, DEFAULT_NUM_ROUTING_TABLES); }
From source file:com.linkedin.pinot.core.query.scheduler.resources.ResourceManager.java
/** * @param config configuration for initializing resource manager */// w ww . j ava 2s . c om public ResourceManager(Configuration config) { numQueryRunnerThreads = config.getInt(QUERY_RUNNER_CONFIG_KEY, DEFAULT_QUERY_RUNNER_THREADS); numQueryWorkerThreads = config.getInt(QUERY_WORKER_CONFIG_KEY, DEFAULT_QUERY_WORKER_THREADS); LOGGER.info("Initializing with {} query runner threads and {} worker threads", numQueryRunnerThreads, numQueryWorkerThreads); // pqr -> pinot query runner (to give short names) ThreadFactory queryRunnerFactory = new ThreadFactoryBuilder().setDaemon(false) .setPriority(QUERY_RUNNER_THREAD_PRIORITY).setNameFormat("pqr-%d").build(); queryRunners = MoreExecutors .listeningDecorator(Executors.newFixedThreadPool(numQueryRunnerThreads, queryRunnerFactory)); // pqw -> pinot query workers ThreadFactory queryWorkersFactory = new ThreadFactoryBuilder().setDaemon(false) .setPriority(Thread.NORM_PRIORITY).setNameFormat("pqw-%d").build(); queryWorkers = MoreExecutors .listeningDecorator(Executors.newFixedThreadPool(numQueryWorkerThreads, queryWorkersFactory)); }
From source file:com.linkedin.pinot.filesystem.HadoopPinotFS.java
@Override public void init(Configuration config) { try {//from ww w . j a v a 2s .c o m retryCount = config.getInt(RETRY, retryCount); retryWaitMs = config.getInt(RETRY_WAITIME_MS, retryWaitMs); hadoopConf = getConf(config.getString(HADOOP_CONF_PATH)); authenticate(hadoopConf, config); hadoopFS = org.apache.hadoop.fs.FileSystem.get(hadoopConf); LOGGER.info("successfully initialized HadoopPinotFS"); } catch (IOException e) { throw new RuntimeException("Could not initialize HadoopPinotFS", e); } }
From source file:com.parallax.server.blocklyprop.monitoring.Monitor.java
@Inject public Monitor(Configuration configuration) { consoleEnabled = configuration.getBoolean("monitor.console.enabled", false); consoleReportingInterval = configuration.getInt("monitor.console.interval", 300); graphiteEnabled = configuration.getBoolean("monitor.graphite.enabled", false); graphitePrefix = configuration.getString("monitor.graphite.prefix", "blocklyprop"); graphiteServerAddress = configuration.getString("monitor.graphite.address", "localhost"); graphiteServerPort = configuration.getInt("monitor.graphite.port", 2003); graphiteReportingInterval = configuration.getInt("monitor.graphite.interval", 30); init();/*from ww w .j a v a2 s.com*/ }
From source file:com.linkedin.pinot.core.query.scheduler.QueryScheduler.java
public QueryScheduler(@Nonnull Configuration schedulerConfig, QueryExecutor queryExecutor) { Preconditions.checkNotNull(schedulerConfig); numQueryRunnerThreads = schedulerConfig.getInt(QUERY_RUNNER_CONFIG_KEY, DEFAULT_QUERY_RUNNER_THREADS); numQueryWorkerThreads = schedulerConfig.getInt(QUERY_WORKER_CONFIG_KEY, DEFAULT_QUERY_WORKER_THREADS); queryRunners = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(numQueryRunnerThreads)); queryWorkers = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(numQueryWorkerThreads)); this.queryExecutor = queryExecutor; }
From source file:net.sf.jclal.util.random.RanluxFactory.java
/** * * @param configuration The configuration of RanluxFactory. * <p>/*w w w . ja va2s . c o m*/ * luxury-level= int</p> */ @Override public void configure(Configuration configuration) { // Call super method super.configure(configuration); // Initialize luxury level int luxuryLevelN = configuration.getInt("[@luxury-level]", 3); setLuxuryLevel(luxuryLevelN); }
From source file:com.caricah.iotracah.server.httpserver.netty.HttpServerImpl.java
/** * @param configuration Object carrying all configurable properties from file. * @throws UnRetriableException/*from w w w.jav a 2 s .c om*/ * @link configure method supplies the configuration object carrying all the * properties parsed from the external properties file. */ public void configure(Configuration configuration) throws UnRetriableException { log.info(" configure : setting up our configurations."); int tcpPort = configuration.getInt(CONFIGURATION_SERVER_HTTP_TCP_PORT, CONFIGURATION_VALUE_DEFAULT_SERVER_HTTP_TCP_PORT); setTcpPort(tcpPort); int sslPort = configuration.getInt(CONFIGURATION_SERVER_HTTP_SSL_PORT, CONFIGURATION_VALUE_DEFAULT_SERVER_HTTP_SSL_PORT); setSslPort(sslPort); boolean sslEnabled = configuration.getBoolean(CONFIGURATION_SERVER_HTTP_SSL_IS_ENABLED, CONFIGURATION_VALUE_DEFAULT_SERVER_HTTP_SSL_IS_ENABLED); setSslEnabled(sslEnabled); if (isSslEnabled()) { setSslHandler(new SSLHandler(configuration)); } int connectionTimeout = configuration.getInt(CONFIGURATION_SERVER_HTTP_CONNECTION_TIMEOUT, CONFIGURATION_VALUE_DEFAULT_SERVER_HTTP_CONNECTION_TIMEOUT); setConnectionTimeout(connectionTimeout); }
From source file:com.microrisc.simply.SimpleDeviceObjectFactory.java
/** * Creates new results container./* w w w .j a v a2 s. c om*/ */ private CallRequestProcessingInfoContainer createResultsContainer(Configuration configuration) { logger.debug("createResultsContainer - start: configuration={}", configuration); int capacity = configuration.getInt("deviceObject.resultsContainer.capacity", HashMapResultsContainer.DEFAULT_CAPACITY); long maxTimeDuration = configuration.getLong("deviceObject.resultsContainer.maxTimeDuration", HashMapResultsContainer.DEFAULT_MAX_TIME_DURATION); CallRequestProcessingInfoContainer resultsContainer = new HashMapCallRequestProcessingInfoContainer( capacity, maxTimeDuration); logger.debug("createResultsContainer - end: {}", resultsContainer); return resultsContainer; }
From source file:com.evolveum.midpoint.web.security.WebApplicationConfiguration.java
public WebApplicationConfiguration(Configuration config) { importFolder = config.getString("importFolder"); exportFolder = config.getString("exportFolder"); progressRefreshInterval = config.getInt("progressRefreshInterval", 400); abortEnabled = config.getBoolean("abortEnabled", true); if (abortEnabled && !isProgressReportingEnabled()) { LOGGER.warn(// w ww . j av a 2 s . c o m "Abort functionality requires progress reporting to be enabled - set progressRefreshInterval in '" + MidPointApplication.WEB_APP_CONFIGURATION + "' section to a non-zero value"); abortEnabled = false; } String midpointHome = System.getProperty(MIDPOINT_HOME); if (importFolder == null) { if (StringUtils.isNotEmpty(midpointHome)) { importFolder = midpointHome + "/tmp"; } else { importFolder = "."; } } if (exportFolder == null) { if (StringUtils.isNotEmpty(midpointHome)) { exportFolder = midpointHome + "/tmp"; } else { exportFolder = "."; } } }
From source file:com.microrisc.simply.network.serial.v1.SerialNetworkLayerFactory.java
/** * Creates network layer parameters encapsulation object. * @param connectionStorage/*from w w w . j av a 2 s. c om*/ * @param configProps * @return network layer parameters encapsulation object */ private NetworkLayerParams createNetworkLayerParams(NetworkConnectionStorage connectionStorage, Configuration configProps) { String portName = configProps.getString("networkLayer.type.serial.port", AUTOCONF); int serialBaudrate = configProps.getInt("networkLayer.type.serial.baudrate", 19200); return new NetworkLayerParams(connectionStorage, portName, serialBaudrate); }