V
- public class RejoinAwareBlockingOperation<V>
extends java.lang.Object
implements java.util.concurrent.Callable<V>
Callable
implementation that accepts another callable delegate for executing it in nonstop+rejoin context.
Executing the call()
operation will execute the delegate callable and block until it returns. On rejoin, the delegate callable
is executed again.Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Callable<V> |
delegateCallable |
private java.lang.Thread |
executingThread |
private ExecutorServiceStore |
executorServiceStore |
private static org.slf4j.Logger |
LOGGER |
private static long |
REJOIN_RETRY_INTERVAL |
private boolean |
rejoinHappened |
Constructor and Description |
---|
RejoinAwareBlockingOperation(ExecutorServiceStore executorServiceStore,
java.util.concurrent.Callable<V> callable)
Public constructor
|
Modifier and Type | Method and Description |
---|---|
V |
call()
.
|
void |
clusterRejoined()
Called when cluster rejoin happens
|
private V |
executeUntilComplete() |
private static final org.slf4j.Logger LOGGER
private static final long REJOIN_RETRY_INTERVAL
private final java.util.concurrent.Callable<V> delegateCallable
private final ExecutorServiceStore executorServiceStore
private volatile java.lang.Thread executingThread
private volatile boolean rejoinHappened
public RejoinAwareBlockingOperation(ExecutorServiceStore executorServiceStore, java.util.concurrent.Callable<V> callable)
executorServiceStore
- callable
- public V call() throws java.lang.Exception
InterruptedException
if the executing thread is interrupted before the call returnscall
in interface java.util.concurrent.Callable<V>
java.lang.Exception
private V executeUntilComplete() throws java.lang.Exception
java.lang.Exception
public void clusterRejoined()