@InterfaceAudience.Private public class DelayingRunner 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 |
actions |
private static org.slf4j.Logger |
LOG |
private Runnable |
runnable |
private Object |
sleepLock |
private long |
sleepTime |
private boolean |
triggerWake |
Constructor and Description |
---|
DelayingRunner(long sleepTime,
Map.Entry<byte[],List<Action>> e) |
Modifier and Type | Method and Description |
---|---|
void |
add(Map.Entry<byte[],List<Action>> e) |
MultiAction |
getActions() |
long |
getSleepTime() |
void |
run() |
void |
setRunner(Runnable runner) |
private boolean |
sleep()
Sleep for an expected amount of time.
|
private static final org.slf4j.Logger LOG
private boolean triggerWake
private long sleepTime
private MultiAction actions
public DelayingRunner(long sleepTime, Map.Entry<byte[],List<Action>> e)
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 getActions()
public long getSleepTime()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.