public class UpdatePuller extends Object implements Runnable, org.neo4j.kernel.lifecycle.Lifecycle
pullUpdates
TransactionObligationFulfiller#fulfill(long) will {@link UpdatePuller#poke() poke} that single thread, so that
it gets going, if not already doing so, with its usual task of pulling updates and the caller which poked
the update thread will constantly poll to see if the transactions it is obliged to await have been applied.
Here comes a diagram of how the classes making up this functionality hangs together:
-------- 1 -------------------->({@link MasterImpl master})
/ |
| /
| v--------------------- 2 --------
({@link MasterClient slave})
| ^ \
| | -------- 3 -----
| \ \
| \ v
| ---- 8 -----------({@link TransactionCommittingResponseUnpacker response unpacker})
| | ^
9 | |
(continue) 4 7
| |
v |
({@link UpdatePullingTransactionObligationFulfiller obligation fulfiller})
| ^
| |
5 6
| |
v |
({@link UpdatePuller update puller})
In the above picture:
| Modifier and Type | Field and Description |
|---|---|
static org.neo4j.kernel.ha.UpdatePuller.Condition |
NEXT_TICKET |
| Modifier and Type | Method and Description |
|---|---|
boolean |
await(org.neo4j.kernel.ha.UpdatePuller.Condition condition,
boolean strictlyAssertActive)
Gets the update puller going, if it's not already going, and waits for the supplied condition to be
fulfilled as part of the update pulling happening.
|
void |
init() |
boolean |
isActive() |
void |
pause() |
void |
run() |
void |
shutdown() |
void |
start() |
void |
stop() |
String |
toString() |
void |
unpause() |
public void init()
throws Throwable
init in interface org.neo4j.kernel.lifecycle.LifecycleThrowablepublic void start()
start in interface org.neo4j.kernel.lifecycle.Lifecyclepublic void stop()
stop in interface org.neo4j.kernel.lifecycle.Lifecyclepublic void shutdown()
throws Throwable
shutdown in interface org.neo4j.kernel.lifecycle.LifecycleThrowablepublic void pause()
public void unpause()
public boolean await(org.neo4j.kernel.ha.UpdatePuller.Condition condition,
boolean strictlyAssertActive)
throws InterruptedException
condition - Condition to wait for.strictlyAssertActive - if true then observing an inactive update puller, whether
halted or paused, will throw an IllegalStateException,
otherwise if false just stop waiting and return false.strictlyAssertActive either
true will be returned or exception thrown, if puller became inactive.
If !strictlyAssertActive and puller became inactive then false is returned.InterruptedException - if we were interrupted while awaiting the condition.IllegalStateException - if strictlyAssertActive and the update puller
became inactive while awaiting the condition.public boolean isActive()
Copyright © 2002–2015 The Neo4j Graph Database Project. All rights reserved.