Examples of NamedThreadFactory


Examples of ar.util.NamedThreadFactory

public class MostRecentOnlyExecutor extends ThreadPoolExecutor {
  public MostRecentOnlyExecutor(int corePoolSize, String threadNameBase) {
    super(corePoolSize, corePoolSize,
        1, TimeUnit.SECONDS,
        new ArrayBlockingQueue<Runnable>(1),
        new NamedThreadFactory(threadNameBase, true),
        new ThreadPoolExecutor.DiscardOldestPolicy());
  }
View Full Code Here

Examples of com.alibaba.asyncload.impl.pool.NamedThreadFactory

        if (isInit == false) {
            RejectedExecutionHandler handler = getHandler(mode);
            BlockingQueue queue = getBlockingQueue(acceptCount, mode);
            // 构造pool池
            this.pool = new AsyncLoadThreadPool(poolSize, poolSize, 0L, TimeUnit.MILLISECONDS, queue,
                                                new NamedThreadFactory(), handler);

            isInit = true;
        }
    }
View Full Code Here

Examples of com.alibaba.dubbo.common.utils.NamedThreadFactory

            logger.warn(e.getMessage(), e);
        }
    }
   
    protected ExecutorService createExecutor() {
        return Executors.newCachedThreadPool(new NamedThreadFactory(CLIENT_THREAD_POOL_NAME + CLIENT_THREAD_POOL_ID.incrementAndGet() + "-" + getUrl().getAddress(), true));
    }
View Full Code Here

Examples of com.alibaba.otter.shared.common.utils.thread.NamedThreadFactory

        this.useBatch = pipeline.getParameters().isUseBatch();
    }

    public void afterPropertiesSet() throws Exception {
        executor = new ThreadPoolExecutor(poolSize, poolSize, 0L, TimeUnit.MILLISECONDS,
                                          new ArrayBlockingQueue(poolSize * 4), new NamedThreadFactory(WORKER_NAME),
                                          new ThreadPoolExecutor.CallerRunsPolicy());
    }
View Full Code Here

Examples of com.cloud.utils.concurrency.NamedThreadFactory

        s_logger.info("Storage cleanup enabled: " + _storageCleanupEnabled + ", interval: " + _storageCleanupInterval + ", template cleanup enabled: " + _templateCleanupEnabled);

        String workers = configs.get("expunge.workers");
        int wrks = NumbersUtil.parseInt(workers, 10);
        _executor = Executors.newScheduledThreadPool(wrks, new NamedThreadFactory("StorageManager-Scavenger"));

        _agentMgr.registerForHostEvents(ComponentLocator.inject(LocalStoragePoolListener.class), true, false, false);

        String maxVolumeSizeInGbString = configDao.getValue("storage.max.volume.size");
        _maxVolumeSizeInGb = NumbersUtil.parseLong(maxVolumeSizeInGbString, 2000);
View Full Code Here

Examples of com.cloud.utils.concurrency.NamedThreadFactory

        NicForTrafficTypeSearch.join("network", networkSearch, networkSearch.entity().getId(), NicForTrafficTypeSearch.entity().getNetworkId(), JoinType.INNER);
        NicForTrafficTypeSearch.and("instance", NicForTrafficTypeSearch.entity().getInstanceId(), Op.EQ);
        networkSearch.and("traffictype", networkSearch.entity().getTrafficType(), Op.EQ);
        NicForTrafficTypeSearch.done();

        _executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("Network-Scavenger"));

        _allowSubdomainNetworkAccess = Boolean.valueOf(_configs.get(Config.SubDomainNetworkAccess.key()));

        _agentMgr.registerForHostEvents(this, true, false, true);
View Full Code Here

Examples of com.cloud.utils.concurrency.NamedThreadFactory

    @Override
    public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
        _name = name;

        _executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("RouterMonitor"));
        _checkExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("RouterStatusMonitor"));
        _networkStatsUpdateExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("NetworkStatsUpdater"));

        final ComponentLocator locator = ComponentLocator.getCurrentLocator();

        final Map<String, String> configs = _configDao.getConfiguration("AgentManager", params);
View Full Code Here

Examples of com.cloud.utils.concurrency.NamedThreadFactory

        _gson = GsonHelper.getGson();

        // executor to perform remote-calls in another thread context, to avoid potential
        // recursive remote calls between nodes
        //
        _executor = Executors.newCachedThreadPool(new NamedThreadFactory("Cluster-Worker"));
    }
View Full Code Here

Examples of com.facebook.concurrency.NamedThreadFactory

  ) {
    this(
      zkConnectionManager,
      retryIntervalMillis,
      Executors.newSingleThreadExecutor(
        new NamedThreadFactory("ZkApplication-watch")
      ),
      Executors.newSingleThreadScheduledExecutor(
        new NamedThreadFactory("ZkApplication-retry")
      )
    );
  }
View Full Code Here

Examples of com.flipkart.phantom.runtime.impl.server.concurrent.NamedThreadFactory

               this.setServerExecutors(new ThreadPoolExecutor(this.getServerPoolSize(),
                    this.getServerPoolSize(),
                    60,
                    TimeUnit.SECONDS,
                    new LinkedBlockingQueue<Runnable>(this.getExecutorQueueSize()),
                    new NamedThreadFactory("TCPServer-Listener"),
                    new ThreadPoolExecutor.CallerRunsPolicy()));
            }
            else { // default behavior of creating and using a cached thread pool
        this.setServerExecutors(Executors.newCachedThreadPool(new NamedThreadFactory("TCPServer-Listener")));
      }
        }
        if (this.getWorkerExecutors() == null) {  // no executors have been set for workers
            if (this.getWorkerPoolSize() != TCPNettyServer.INVALID_POOL_SIZE) { // thread pool size has not been set.
                this.setWorkerExecutors(new ThreadPoolExecutor(this.getWorkerPoolSize(),
                        this.getWorkerPoolSize(),
                        60,
                        TimeUnit.SECONDS,
                        new LinkedBlockingQueue<Runnable>(this.getExecutorQueueSize()),
                        new NamedThreadFactory("TCPServer-Worker"),
                        new ThreadPoolExecutor.CallerRunsPolicy()));
            } else { // default behavior of creating and using a cached thread pool
                this.setWorkerExecutors(Executors.newCachedThreadPool(new NamedThreadFactory("TCPServer-Worker")));
            }
        }
        super.afterPropertiesSet();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.