Package com.alibaba.otter.shared.common.utils.thread

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


        mainStemData.setStatus(MainStemEventData.Status.OVERTAKE);
        arbitrateEventService.mainStemEvent().single(mainStemData);

        // 启动异步线程定时监控,一定会有数据过来
        String schedulerName = String.format("pipelineId = %s , CanalDetecting", String.valueOf(pipelineId));
        scheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory(schedulerName));
        future = scheduler.scheduleAtFixedRate(new Runnable() {

            public void run() {
                try {
                    MDC.put(OtterConstants.splitPipelineLogFileKey, String.valueOf(pipelineId));
View Full Code Here

        }
    }

    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

        });
    }

    // ================= helper method ==============
    public void afterPropertiesSet() throws Exception {
        scheduler = new ScheduledThreadPoolExecutor(DEFAULT_POOL, new NamedThreadFactory("Otter-Statistics-Client"),
                                                    new ThreadPoolExecutor.CallerRunsPolicy());
        scheduler.submit(new Runnable() {

            public void run() {
                doSendDelayCountEvent();
View Full Code Here

            tableStats.clear();
        }
    }

    public void afterPropertiesSet() throws Exception {
        scheduler = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("Otter-Statistics-Table"),
                                                    new ThreadPoolExecutor.CallerRunsPolicy());
        if (statUnit > 0) {
            scheduler.scheduleAtFixedRate(new Runnable() {

                public void run() {
View Full Code Here

            public Map<ThroughputType, ThroughputStat> apply(Long pipelineId) {
                return new HashMap<ThroughputType, ThroughputStat>();
            }
        });

        scheduler = new ScheduledThreadPoolExecutor(DEFAULT_POOL, new NamedThreadFactory("Otter-Statistics-Server"),
                                                    new ThreadPoolExecutor.CallerRunsPolicy());
        if (statUnit > 0) {
            scheduler.scheduleAtFixedRate(new Runnable() {

                public void run() {
View Full Code Here

            handler = new ThreadPoolExecutor.AbortPolicy();
        }

        executor = new ThreadPoolExecutor(poolSize, poolSize, 60 * 1000L, TimeUnit.MILLISECONDS,
                                          new LinkedBlockingQueue<Runnable>(10 * 1000),
                                          new NamedThreadFactory("communication-async"), handler);
    }
View Full Code Here

        ExecutorService executor = new ThreadPoolExecutor(thread,
            thread,
            60,
            TimeUnit.SECONDS,
            new ArrayBlockingQueue(thread * 2),
            new NamedThreadFactory("load"),
            new ThreadPoolExecutor.CallerRunsPolicy());

        for (int sec = 0; sec < minute * 60; sec++) {
            // 执行秒循环
            long startTime = System.currentTimeMillis();
View Full Code Here

            public Map<ThroughputType, ThroughputStat> apply(Long pipelineId) {
                return new HashMap<ThroughputType, ThroughputStat>();
            }
        });

        scheduler = new ScheduledThreadPoolExecutor(DEFAULT_POOL, new NamedThreadFactory("Otter-Statistics-Server"),
                                                    new ThreadPoolExecutor.CallerRunsPolicy());
        if (statUnit > 0) {
            scheduler.scheduleAtFixedRate(new Runnable() {

                public void run() {
View Full Code Here

        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

TOP

Related Classes of com.alibaba.otter.shared.common.utils.thread.NamedThreadFactory

Copyright © 2018 www.massapicom. 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.