Search in sources :

Example 1 with CatchUpClientException

use of org.neo4j.causalclustering.catchup.CatchUpClientException in project neo4j by neo4j.

the class RemoteStore method pullTransactions.

private CatchupResult pullTransactions(MemberId from, StoreId expectedStoreId, File storeDir, long fromTxId, boolean asPartOfStoreCopy) throws IOException, StoreCopyFailedException {
    try (TransactionLogCatchUpWriter writer = transactionLogFactory.create(storeDir, fs, pageCache, logProvider, fromTxId, asPartOfStoreCopy)) {
        log.info("Pulling transactions from: %d", fromTxId);
        long previousTxId = fromTxId - 1;
        CatchupResult lastStatus;
        do {
            TxPullRequestResult result = txPullClient.pullTransactions(from, expectedStoreId, previousTxId, writer);
            lastStatus = result.catchupResult();
            previousTxId = result.lastTxId();
        } while (lastStatus == SUCCESS_END_OF_BATCH);
        return lastStatus;
    } catch (CatchUpClientException e) {
        throw new StoreCopyFailedException(e);
    }
}
Also used : TransactionLogCatchUpWriter(org.neo4j.causalclustering.catchup.tx.TransactionLogCatchUpWriter) CatchupResult(org.neo4j.causalclustering.catchup.CatchupResult) CatchUpClientException(org.neo4j.causalclustering.catchup.CatchUpClientException) TxPullRequestResult(org.neo4j.causalclustering.catchup.TxPullRequestResult)

Aggregations

CatchUpClientException (org.neo4j.causalclustering.catchup.CatchUpClientException)1 CatchupResult (org.neo4j.causalclustering.catchup.CatchupResult)1 TxPullRequestResult (org.neo4j.causalclustering.catchup.TxPullRequestResult)1 TransactionLogCatchUpWriter (org.neo4j.causalclustering.catchup.tx.TransactionLogCatchUpWriter)1