Search in sources :

Example 1 with PaxosInstanceStore

use of org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.PaxosInstanceStore in project neo4j by neo4j.

the class MultiPaxosContext method snapshot.

/** Create a state snapshot. The snapshot will not duplicate services, and expects the caller to duplicate
     * {@link AcceptorInstanceStore}, since that is externally provided.  */
public MultiPaxosContext snapshot(LogProvider logging, Timeouts timeouts, Executor executor, AcceptorInstanceStore instanceStore, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory, ElectionCredentialsProvider electionCredentialsProvider) {
    CommonContextState commonStateSnapshot = commonState.snapshot(logging.getLog(ClusterConfiguration.class));
    PaxosInstanceStore paxosInstancesSnapshot = paxosInstances.snapshot();
    HeartbeatContextImpl snapshotHeartbeatContext = heartbeatContext.snapshot(commonStateSnapshot, logging, timeouts, executor);
    LearnerContextImpl snapshotLearnerContext = learnerContext.snapshot(commonStateSnapshot, logging, timeouts, paxosInstancesSnapshot, instanceStore, objectInputStreamFactory, objectOutputStreamFactory, snapshotHeartbeatContext);
    ClusterContextImpl snapshotClusterContext = clusterContext.snapshot(commonStateSnapshot, logging, timeouts, executor, objectOutputStreamFactory, objectInputStreamFactory, snapshotLearnerContext, snapshotHeartbeatContext);
    ElectionContextImpl snapshotElectionContext = electionContext.snapshot(commonStateSnapshot, logging, timeouts, snapshotClusterContext, snapshotHeartbeatContext, electionCredentialsProvider);
    ProposerContextImpl snapshotProposerContext = proposerContext.snapshot(commonStateSnapshot, logging, timeouts, paxosInstancesSnapshot, heartbeatContext);
    AcceptorContextImpl snapshotAcceptorContext = acceptorContext.snapshot(commonStateSnapshot, logging, timeouts, instanceStore);
    AtomicBroadcastContextImpl snapshotAtomicBroadcastContext = atomicBroadcastContext.snapshot(commonStateSnapshot, logging, timeouts, executor, snapshotHeartbeatContext);
    snapshotHeartbeatContext.setCircularDependencies(snapshotClusterContext, snapshotLearnerContext);
    return new MultiPaxosContext(snapshotProposerContext, snapshotAcceptorContext, snapshotLearnerContext, snapshotHeartbeatContext, snapshotElectionContext, snapshotAtomicBroadcastContext, commonStateSnapshot, paxosInstancesSnapshot, snapshotClusterContext);
}
Also used : PaxosInstanceStore(org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.PaxosInstanceStore) ClusterConfiguration(org.neo4j.cluster.protocol.cluster.ClusterConfiguration)

Aggregations

PaxosInstanceStore (org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.PaxosInstanceStore)1 ClusterConfiguration (org.neo4j.cluster.protocol.cluster.ClusterConfiguration)1