Search in sources :

Example 1 with UpstreamDatabaseSelectionException

use of org.neo4j.causalclustering.readreplica.UpstreamDatabaseSelectionException in project neo4j by neo4j.

the class CatchupPollingProcess method pullTransactions.

private void pullTransactions() {
    MemberId upstream;
    try {
        upstream = selectionStrategyPipeline.bestUpstreamDatabase();
    } catch (UpstreamDatabaseSelectionException e) {
        log.warn("Could not find upstream database from which to pull.", e);
        return;
    }
    StoreId localStoreId = localDatabase.storeId();
    boolean moreToPull = true;
    int batchCount = 1;
    while (moreToPull) {
        moreToPull = pullAndApplyBatchOfTransactions(upstream, localStoreId, batchCount);
        batchCount++;
    }
}
Also used : MemberId(org.neo4j.causalclustering.identity.MemberId) StoreId(org.neo4j.causalclustering.identity.StoreId) UpstreamDatabaseSelectionException(org.neo4j.causalclustering.readreplica.UpstreamDatabaseSelectionException)

Example 2 with UpstreamDatabaseSelectionException

use of org.neo4j.causalclustering.readreplica.UpstreamDatabaseSelectionException in project neo4j by neo4j.

the class CatchupPollingProcess method copyStore.

private void copyStore() {
    MemberId upstream;
    try {
        upstream = selectionStrategyPipeline.bestUpstreamDatabase();
    } catch (UpstreamDatabaseSelectionException e) {
        log.warn("Could not find upstream database from which to copy store", e);
        return;
    }
    StoreId localStoreId = localDatabase.storeId();
    downloadDatabase(upstream, localStoreId);
}
Also used : MemberId(org.neo4j.causalclustering.identity.MemberId) StoreId(org.neo4j.causalclustering.identity.StoreId) UpstreamDatabaseSelectionException(org.neo4j.causalclustering.readreplica.UpstreamDatabaseSelectionException)

Aggregations

MemberId (org.neo4j.causalclustering.identity.MemberId)2 StoreId (org.neo4j.causalclustering.identity.StoreId)2 UpstreamDatabaseSelectionException (org.neo4j.causalclustering.readreplica.UpstreamDatabaseSelectionException)2