package com.biaodian.xxljob.constant;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
public class PoolConstant {
public static final Integer INTEGER_ZERO = 0;
public static final Integer INTEGER_ONE = 1, INTEGER_TWO = 2, INTEGER_THREE = 3, INTEGER_FIVE = 5, INTEGER_FOR = 4;
public static final Integer INTEGER_TEN = 10, INTEGER_THIRTY= 30, INTEGER_FIFTY = 50;
public static final Integer INTEGER_ONE_HUNDRED = 100, INTEGER_TWO_HUNDRED = 200, INTEGER_THREE_HUNDRED = 300, INTEGER_FIVE_HUNDRED = 500;
public static final Integer INTEGER_ONE_THOUSAND = 1000, INTEGER_TEN_THOUSAND = 10000;
public static final Long THREE_DAYS = 2592000000L;
/**
* 线程池线程数
*/
public static final int INIT_THREAD_POOL_SIZE = 32, DEFAULT_THREAD_POOL_SIZE = 32, MAX_THREAD_POOL_SIZE = 100;
/**
* 全局线程工厂
*/
private static final ThreadFactory NAMED_THREAD_FACTORY = new ThreadFactoryBuilder().setNameFormat("tokens-pool-%d").build();
/**
* OKHTTP线程池
*/
public static final ThreadPoolExecutor OKHTTP_THREAD_POOL = new ThreadPoolExecutor(INTEGER_ONE, INTEGER_ONE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_FOR), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
// /**
// * 重试线程池
// */
// public static final ThreadPoolExecutor RETRY_THREAD_POOL = new ThreadPoolExecutor(INIT_THREAD_POOL_SIZE, INIT_THREAD_POOL_SIZE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.AbortPolicy());
/**
* 公共线程池
*/
public static final ThreadPoolExecutor COMMON_THREAD_POOL = new ThreadPoolExecutor(INTEGER_ONE, INTEGER_ONE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_FOR), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
/**
* 对账订单线程池
*/
public static final ThreadPoolExecutor ORDER_THREAD_POOL = new ThreadPoolExecutor(INTEGER_FIVE, INTEGER_FIVE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
/**
* 站点基本信息线程池
*/
//public static final ThreadPoolExecutor SITE_THREAD_POOL = new ThreadPoolExecutor(INTEGER_TEN, INTEGER_TEN, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
public static final ThreadPoolExecutor SITE_THREAD_POOL = new ThreadPoolExecutor(INTEGER_FIVE, INTEGER_FIVE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
/**
* 达人分析线程池
*/
public static final ThreadPoolExecutor TALENT_THREAD_POOL = new ThreadPoolExecutor(INTEGER_ONE, INTEGER_ONE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
/**
* 线程池为1
*/
public static final ThreadPoolExecutor THREAD_INTEGER_ONE = new ThreadPoolExecutor(INTEGER_ONE, INTEGER_ONE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
/**
* 线程池为5
*/
public static final ThreadPoolExecutor THREAD_INTEGER_FIVE = new ThreadPoolExecutor(INTEGER_FIVE, INTEGER_FIVE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
/**
* 线程池为10
*/
public static final ThreadPoolExecutor THREAD_INTEGER_TEN = new ThreadPoolExecutor(INTEGER_TEN, INTEGER_TEN, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
/**
* 线程池为30
*/
public static final ThreadPoolExecutor THREAD_INTEGER_THIRTY = new ThreadPoolExecutor(INTEGER_THIRTY, INTEGER_THIRTY, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
/**
* 拉取商品线程池
*/
//public static final ThreadPoolExecutor MATE_GOODS_INFO = new ThreadPoolExecutor(INTEGER_ONE, INTEGER_ONE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
public static final ThreadPoolExecutor MATE_GOODS_INFO = new ThreadPoolExecutor(6, 6, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(INTEGER_THIRTY), NAMED_THREAD_FACTORY, new ThreadPoolExecutor.CallerRunsPolicy());
// /**
// * 任务线程池
// */
// public static final ScheduledThreadPoolExecutor SCHEDULED_THREAD_POOL = new ScheduledThreadPoolExecutor(INIT_THREAD_POOL_SIZE, NAMED_THREAD_FACTORY);
//
//
}