@InterfaceAudience.Private public class ProcedureEvent<T> extends Object
| Constructor and Description |
|---|
ProcedureEvent(T object) |
| Modifier and Type | Method and Description |
|---|---|
ProcedureDeque |
getSuspendedProcedures()
Access to suspendedProcedures is 'synchronized' on this object, but it's fine to return it
here for tests.
|
boolean |
isReady() |
void |
suspend()
Mark the event as not ready.
|
boolean |
suspendIfNotReady(Procedure proc) |
String |
toString() |
void |
wake(AbstractProcedureScheduler procedureScheduler)
Wakes up the suspended procedures by pushing them back into scheduler queues and sets the
event as ready.
|
static void |
wakeEvents(AbstractProcedureScheduler scheduler,
ProcedureEvent... events)
Wakes up all the given events and puts the procedures waiting on them back into
ProcedureScheduler queues.
|
boolean |
wakeIfSuspended(AbstractProcedureScheduler procedureScheduler,
Procedure<?> proc)
Wakes up the suspended procedures only if the given
proc is waiting on this event. |
public ProcedureEvent(T object)
public boolean isReady()
public boolean suspendIfNotReady(Procedure proc)
public void suspend()
public void wake(AbstractProcedureScheduler procedureScheduler)
wakeInternal(AbstractProcedureScheduler) for why this is not synchronized.public boolean wakeIfSuspended(AbstractProcedureScheduler procedureScheduler, Procedure<?> proc)
proc is waiting on this event.
Mainly used by region assignment to reject stale OpenRegionProcedure/CloseRegionProcedure. Use
with caution as it will cause performance issue if there are lots of procedures waiting on the
event.public static void wakeEvents(AbstractProcedureScheduler scheduler, ProcedureEvent... events)
public ProcedureDeque getSuspendedProcedures()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.