public class UpdatePuller extends Object implements Runnable, org.neo4j.kernel.lifecycle.Lifecycle
pullUpdates
TransactionObligationFulfiller.fulfill(long) will 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 -------------------->(master)
/ |
| /
| v--------------------- 2 --------
(slave)
| ^ \
| | -------- 3 -----
| \ \
| \ v
| ---- 8 -----------(response unpacker)
| | ^
9 | |
(continue) 4 7
| |
v |
(obligation fulfiller)
| ^
| |
5 6
| |
v |
(update puller)
In the above picture:
transaction obligation telling the slave
which transaction it must have applied before continuingobligation fulfiller...update puller, a separate thread, to have that transaction
committed and applied. The calling thread will gently wait for that to happen.update puller will pull updates until it reaches that desired transaction id,
and might actually continue passed that point if master has more transactions. The obligation fulfiller,
constantly polling for last applied transaction
will notice when the obligation has been fulfilled.fulfill the obligationtransaction data is received and applied to store directly, in batches.| 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 - UpdatePuller.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.