org.neo4j.com
Class MasterUtil
java.lang.Object
org.neo4j.com.MasterUtil
public class MasterUtil
- extends Object
|
Method Summary |
static
|
applyReceivedTransactions(Response<T> response,
GraphDatabaseService graphDb,
MasterUtil.TxHandler txHandler)
|
static Response<Void> |
getTransactions(GraphDatabaseService graphDb,
String dataSourceName,
long startTx,
long endTx)
Given a data source name, a start and an end tx, this method extracts
these transactions (inclusive) in a transaction stream and encapsulates
them in a Response object, ready to be returned to the slave. |
static
|
packResponse(GraphDatabaseService graphDb,
SlaveContext context,
T response,
Predicate<Long> filter)
After having created the response for a slave, this method compares its
context against the local (master's) context and creates a transaction
stream containing all the transactions the slave does not currently
have. |
static
|
packResponseWithoutTransactionStream(GraphDatabaseService graphDb,
SlaveContext context,
T response)
|
static SlaveContext.Tx[] |
rotateLogs(GraphDatabaseService graphDb)
|
static SlaveContext |
rotateLogsAndStreamStoreFiles(GraphDatabaseService graphDb,
boolean includeLogicalLogs,
StoreWriter writer)
|
static MasterUtil.TxHandler |
txHandlerForFullCopy()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALL
public static final Predicate<Long> ALL
NO_ACTION
public static final MasterUtil.TxHandler NO_ACTION
MasterUtil
public MasterUtil()
rotateLogs
public static SlaveContext.Tx[] rotateLogs(GraphDatabaseService graphDb)
rotateLogsAndStreamStoreFiles
public static SlaveContext rotateLogsAndStreamStoreFiles(GraphDatabaseService graphDb,
boolean includeLogicalLogs,
StoreWriter writer)
packResponse
public static <T> Response<T> packResponse(GraphDatabaseService graphDb,
SlaveContext context,
T response,
Predicate<Long> filter)
- After having created the response for a slave, this method compares its
context against the local (master's) context and creates a transaction
stream containing all the transactions the slave does not currently
have. This way every response returned acts as an update for the slave.
- Type Parameters:
T - The type of the response- Parameters:
graphDb - The graph database to usecontext - The slave contextresponse - The response being packedfilter - A Predicate to apply on each txid, selecting only
those that evaluate to true
- Returns:
- The response, packed with the latest transactions
getTransactions
public static Response<Void> getTransactions(GraphDatabaseService graphDb,
String dataSourceName,
long startTx,
long endTx)
- Given a data source name, a start and an end tx, this method extracts
these transactions (inclusive) in a transaction stream and encapsulates
them in a
Response object, ready to be returned to the slave.
- Parameters:
graphDb - The graph database to usedataSourceName - The name of the data source to extract transactions
fromstartTx - The first tx in the returned streamendTx - The last tx in the returned stream
- Returns:
- A
Response object containing a transaction stream with
the requested transactions from the specified data source.
packResponseWithoutTransactionStream
public static <T> Response<T> packResponseWithoutTransactionStream(GraphDatabaseService graphDb,
SlaveContext context,
T response)
applyReceivedTransactions
public static <T> void applyReceivedTransactions(Response<T> response,
GraphDatabaseService graphDb,
MasterUtil.TxHandler txHandler)
throws IOException
- Throws:
IOException
txHandlerForFullCopy
public static MasterUtil.TxHandler txHandlerForFullCopy()
Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.