private void readConf(Configuration conf) { int selectorThreads = conf.getInt( SELECTOR_THREADS_CONF_KEY, getSelectorThreads()); int workerThreads = conf.getInt( WORKER_THREADS_CONF_KEY, getWorkerThreads()); int stopTimeoutVal = conf.getInt( STOP_TIMEOUT_CONF_KEY, getStopTimeoutVal()); int acceptQueueSizePerThread = conf.getInt( ACCEPT_QUEUE_SIZE_PER_THREAD_CONF_KEY, getAcceptQueueSizePerThread()); AcceptPolicy acceptPolicy = AcceptPolicy.valueOf(conf.get( ACCEPT_POLICY_CONF_KEY, getAcceptPolicy().toString()).toUpperCase(Locale.ROOT)); super.selectorThreads(selectorThreads) .workerThreads(workerThreads) .stopTimeoutVal(stopTimeoutVal) .acceptQueueSizePerThread(acceptQueueSizePerThread) .acceptPolicy(acceptPolicy); LOG.info("Read configuration selectorThreads:" + selectorThreads + " workerThreads:" + workerThreads + " stopTimeoutVal:" + stopTimeoutVal + "sec" + " acceptQueueSizePerThread:" + acceptQueueSizePerThread + " acceptPolicy:" + acceptPolicy); } }
private void readConf(Configuration conf) { int selectorThreads = conf.getInt( SELECTOR_THREADS_CONF_KEY, getSelectorThreads()); int workerThreads = conf.getInt( WORKER_THREADS_CONF_KEY, getWorkerThreads()); int stopTimeoutVal = conf.getInt( STOP_TIMEOUT_CONF_KEY, getStopTimeoutVal()); int acceptQueueSizePerThread = conf.getInt( ACCEPT_QUEUE_SIZE_PER_THREAD_CONF_KEY, getAcceptQueueSizePerThread()); AcceptPolicy acceptPolicy = AcceptPolicy.valueOf(conf.get( ACCEPT_POLICY_CONF_KEY, getAcceptPolicy().toString()).toUpperCase()); super.selectorThreads(selectorThreads) .workerThreads(workerThreads) .stopTimeoutVal(stopTimeoutVal) .acceptQueueSizePerThread(acceptQueueSizePerThread) .acceptPolicy(acceptPolicy); LOG.info("Read configuration selectorThreads:" + selectorThreads + " workerThreads:" + workerThreads + " stopTimeoutVal:" + stopTimeoutVal + "sec" + " acceptQueueSizePerThread:" + acceptQueueSizePerThread + " acceptPolicy:" + acceptPolicy); } }
private void readConf(Configuration conf) { int selectorThreads = conf.getInt( SELECTOR_THREADS_CONF_KEY, getSelectorThreads()); int workerThreads = conf.getInt( WORKER_THREADS_CONF_KEY, getWorkerThreads()); int stopTimeoutVal = conf.getInt( STOP_TIMEOUT_CONF_KEY, getStopTimeoutVal()); int acceptQueueSizePerThread = conf.getInt( ACCEPT_QUEUE_SIZE_PER_THREAD_CONF_KEY, getAcceptQueueSizePerThread()); AcceptPolicy acceptPolicy = AcceptPolicy.valueOf(conf.get( ACCEPT_POLICY_CONF_KEY, getAcceptPolicy().toString()).toUpperCase(Locale.ROOT)); super.selectorThreads(selectorThreads) .workerThreads(workerThreads) .stopTimeoutVal(stopTimeoutVal) .acceptQueueSizePerThread(acceptQueueSizePerThread) .acceptPolicy(acceptPolicy); LOG.info("Read configuration selectorThreads:" + selectorThreads + " workerThreads:" + workerThreads + " stopTimeoutVal:" + stopTimeoutVal + "sec" + " acceptQueueSizePerThread:" + acceptQueueSizePerThread + " acceptPolicy:" + acceptPolicy); } }
.processorFactory(processorFactory).protocolFactory(protocolFactory) .transportFactory(transportFactory).workerThreads(numWorkerThreads) .acceptPolicy(AcceptPolicy.FAIR_ACCEPT).acceptQueueSizePerThread(10000) .selectorThreads(numSelectorThreads); args.maxReadBufferBytes = maxReadBufferSize;
private void readConf(Configuration conf) { int selectorThreads = conf.getInt( SELECTOR_THREADS_CONF_KEY, getSelectorThreads()); int workerThreads = conf.getInt( WORKER_THREADS_CONF_KEY, getWorkerThreads()); int stopTimeoutVal = conf.getInt( STOP_TIMEOUT_CONF_KEY, getStopTimeoutVal()); int acceptQueueSizePerThread = conf.getInt( ACCEPT_QUEUE_SIZE_PER_THREAD_CONF_KEY, getAcceptQueueSizePerThread()); AcceptPolicy acceptPolicy = AcceptPolicy.valueOf(conf.get( ACCEPT_POLICY_CONF_KEY, getAcceptPolicy().toString()).toUpperCase(Locale.ROOT)); super.selectorThreads(selectorThreads) .workerThreads(workerThreads) .stopTimeoutVal(stopTimeoutVal) .acceptQueueSizePerThread(acceptQueueSizePerThread) .acceptPolicy(acceptPolicy); LOG.info("Read configuration selectorThreads:" + selectorThreads + " workerThreads:" + workerThreads + " stopTimeoutVal:" + stopTimeoutVal + "sec" + " acceptQueueSizePerThread:" + acceptQueueSizePerThread + " acceptPolicy:" + acceptPolicy); } }