public class TaskQueue extends Object
TaskQueue for each file
and then submit the write tasks to the corresponding queue.
The files will be written concurrently and the writes to each file are in-order.| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
LOG |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
isEmpty()
Is this queue empty?
|
<OUTPUT,THROWABLE extends Throwable> |
submit(CheckedSupplier<OUTPUT,THROWABLE> task,
ExecutorService executor)
The same as submit(task, executor, Function.identity());
|
<OUTPUT,THROWABLE extends Throwable> |
submit(CheckedSupplier<OUTPUT,THROWABLE> task,
ExecutorService executor,
Function<Throwable,Throwable> newThrowable)
Offer the given task to this queue
and then submit the tasks one by one in the queue order for execution.
|
String |
toString() |
public TaskQueue(String name)
public boolean isEmpty()
public <OUTPUT,THROWABLE extends Throwable> CompletableFuture<OUTPUT> submit(CheckedSupplier<OUTPUT,THROWABLE> task, ExecutorService executor)
public <OUTPUT,THROWABLE extends Throwable> CompletableFuture<OUTPUT> submit(CheckedSupplier<OUTPUT,THROWABLE> task, ExecutorService executor, Function<Throwable,Throwable> newThrowable)
OUTPUT - the output type of the task.THROWABLE - the throwable type of the task.task - the task to be submitted.executor - to execute tasks.newThrowable - When the task throws a throwable, create a new Throwable
in order to include more error message.Copyright © 2017–2023 The Apache Software Foundation. All rights reserved.