@InterfaceAudience.Private public class LogRollBackupSubprocedurePool extends Object implements Closeable, Abortable
Modifier and Type | Field and Description |
---|---|
private boolean |
aborted |
private static String |
CONCURENT_BACKUP_TASKS_KEY
Maximum number of concurrent snapshot region tasks that can run concurrently
|
private static int |
DEFAULT_CONCURRENT_BACKUP_TASKS |
private ThreadPoolExecutor |
executor |
private List<Future<Void>> |
futures |
private static org.slf4j.Logger |
LOG |
private String |
name |
private ExecutorCompletionService<Void> |
taskPool |
Constructor and Description |
---|
LogRollBackupSubprocedurePool(String name,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
abort(String why,
Throwable e)
Abort the server or client.
|
void |
close()
Attempt to cleanly shutdown any running tasks - allows currently running tasks to cleanly
finish
|
boolean |
isAborted()
Check if the server or client was aborted.
|
void |
submitTask(Callable<Void> task)
Submit a task to the pool.
|
boolean |
waitForOutstandingTasks()
Wait for all of the currently outstanding tasks submitted via
submitTask(Callable) |
private static final org.slf4j.Logger LOG
private static final String CONCURENT_BACKUP_TASKS_KEY
private static final int DEFAULT_CONCURRENT_BACKUP_TASKS
private final ExecutorCompletionService<Void> taskPool
private final ThreadPoolExecutor executor
private volatile boolean aborted
public LogRollBackupSubprocedurePool(String name, org.apache.hadoop.conf.Configuration conf)
public void submitTask(Callable<Void> task)
public boolean waitForOutstandingTasks() throws ForeignException
submitTask(Callable)
ForeignException
- exceptionpublic void close()
close
in interface Closeable
close
in interface AutoCloseable
public void abort(String why, Throwable e)
Abortable
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.