@InterfaceAudience.Private public class DelayingRunner<T> extends Object implements Runnable
This can be used to build up the actions that should be taken and then
This class exists to simulate using a ScheduledExecutorService with just a regular ExecutorService and Runnables. It is used for legacy reasons in the the client; this could only be removed if we change the expectations in HTable around the pool the client is able to pass in and even if we deprecate the current APIs would require keeping this class around for the interim to bridge between the legacy ExecutorServices and the scheduled pool.
Modifier and Type | Field and Description |
---|---|
private MultiAction<T> |
actions |
private static org.apache.commons.logging.Log |
LOG |
private Runnable |
runnable |
private Object |
sleepLock |
private long |
sleepTime |
private boolean |
triggerWake |
Constructor and Description |
---|
DelayingRunner(long sleepTime,
Map.Entry<byte[],List<Action<T>>> e) |
Modifier and Type | Method and Description |
---|---|
void |
add(Map.Entry<byte[],List<Action<T>>> e) |
MultiAction<T> |
getActions() |
long |
getSleepTime() |
void |
run() |
void |
setRunner(Runnable runner) |
private boolean |
sleep()
Sleep for an expected amount of time.
|
private static final org.apache.commons.logging.Log LOG
private final Object sleepLock
private boolean triggerWake
private long sleepTime
private MultiAction<T> actions
private Runnable runnable
public void setRunner(Runnable runner)
private boolean sleep()
This is nearly a copy of what the Sleeper does, but with the ability to know if you got interrupted while sleeping.
public MultiAction<T> getActions()
public long getSleepTime()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.