类 ParallelTaskScheduler
java.lang.Object
cn.zhxu.toys.concurrent.ParallelTaskScheduler
- 所有已实现的接口:
ParallelScheduler,Executor,ExecutorService
平行机调度器
- 从以下版本开始:
- v0.3.3
- 作者:
- Troy.Zhou
-
嵌套类概要
从接口继承的嵌套类/接口 cn.zhxu.toys.concurrent.ParallelScheduler
ParallelScheduler.Identify<T>, ParallelScheduler.SelfIdentify<T extends Number>, ParallelScheduler.TaskExecutor<T>, ParallelScheduler.TaskProvider<T> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明<T> Future<?>asyncSchedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor) 异步调度平行机<T> Future<?>asyncSchedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor, ParallelScheduler.Identify<T> identify) 异步调度平行机booleanawaitTermination(long timeout, TimeUnit unit) voidinvokeAll(Collection<? extends Callable<T>> tasks) invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) <T> TinvokeAny(Collection<? extends Callable<T>> tasks) <T> TinvokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) booleanboolean<T> voidschedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor) 同步调度平行机<T> voidschedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor, ParallelScheduler.Identify<T> identify) 同步调度平行机voidsetBatchSize(int batchSize) voidsetVerbose(boolean verbose) voidshutdown()Future<?><T> Future<T><T> Future<T>protected <T> voidsubmitTasks(int concurrency, Queue<T> tasks, ParallelScheduler.TaskExecutor<T> executor, List<Future<?>> futures)
-
构造器详细资料
-
ParallelTaskScheduler
public ParallelTaskScheduler() -
ParallelTaskScheduler
public ParallelTaskScheduler(int corePoolSize) -
ParallelTaskScheduler
-
-
方法详细资料
-
schedule
public <T> void schedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor) 同步调度平行机- 指定者:
schedule在接口中ParallelScheduler- 参数:
concurrency- 最大并发量provider- 任务提供者executor- 任务执行器
-
schedule
public <T> void schedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor, ParallelScheduler.Identify<T> identify) 同步调度平行机- 指定者:
schedule在接口中ParallelScheduler- 参数:
concurrency- 最大并发量provider- 任务提供者executor- 任务执行器identify- 任务标识器,用于对provider提供的任务进行去重
-
asyncSchedule
public <T> Future<?> asyncSchedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor) 异步调度平行机- 指定者:
asyncSchedule在接口中ParallelScheduler- 参数:
concurrency- 最大并发量provider- 任务提供者executor- 任务执行器
-
asyncSchedule
public <T> Future<?> asyncSchedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor, ParallelScheduler.Identify<T> identify) 异步调度平行机- 指定者:
asyncSchedule在接口中ParallelScheduler- 参数:
concurrency- 最大并发量provider- 任务提供者executor- 任务执行器identify- 任务标识器,用于对provider提供的任务进行去重
-
execute
-
shutdown
public void shutdown()- 指定者:
shutdown在接口中ExecutorService
-
shutdownNow
- 指定者:
shutdownNow在接口中ExecutorService
-
isShutdown
public boolean isShutdown()- 指定者:
isShutdown在接口中ExecutorService
-
isTerminated
public boolean isTerminated()- 指定者:
isTerminated在接口中ExecutorService
-
awaitTermination
- 指定者:
awaitTermination在接口中ExecutorService- 抛出:
InterruptedException
-
submit
- 指定者:
submit在接口中ExecutorService
-
submit
- 指定者:
submit在接口中ExecutorService
-
submit
- 指定者:
submit在接口中ExecutorService
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException - 指定者:
invokeAll在接口中ExecutorService- 抛出:
InterruptedException
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException - 指定者:
invokeAll在接口中ExecutorService- 抛出:
InterruptedException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException - 指定者:
invokeAny在接口中ExecutorService- 抛出:
InterruptedExceptionExecutionException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException -
submitTasks
protected <T> void submitTasks(int concurrency, Queue<T> tasks, ParallelScheduler.TaskExecutor<T> executor, List<Future<?>> futures) -
setBatchSize
public void setBatchSize(int batchSize) -
setVerbose
public void setVerbose(boolean verbose)
-