use of org.neo4j.causalclustering.core.state.storage.SimpleFileStorage in project neo4j by neo4j.
the class ClusterBindingIT method changeClusterId.
private void changeClusterId(CoreClusterMember coreMember) throws IOException {
SimpleStorage<ClusterId> clusterIdStorage = new SimpleFileStorage<>(fs, coreMember.clusterStateDirectory(), CLUSTER_ID_NAME, new ClusterId.Marshal(), NullLogProvider.getInstance());
clusterIdStorage.writeState(new ClusterId(UUID.randomUUID()));
}
use of org.neo4j.causalclustering.core.state.storage.SimpleFileStorage in project neo4j by neo4j.
the class DumpClusterStateTest method createStates.
private void createStates() throws IOException {
SimpleStorage<MemberId> memberIdStorage = new SimpleFileStorage<>(fsa.get(), clusterStateDirectory.get(), CORE_MEMBER_ID_NAME, new MemberId.Marshal(), NullLogProvider.getInstance());
memberIdStorage.writeState(new MemberId(UUID.randomUUID()));
createDurableState(LAST_FLUSHED_NAME, new LongIndexMarshal());
createDurableState(LOCK_TOKEN_NAME, new ReplicatedLockTokenState.Marshal(new MemberId.Marshal()));
createDurableState(ID_ALLOCATION_NAME, new IdAllocationState.Marshal());
createDurableState(SESSION_TRACKER_NAME, new GlobalSessionTrackerState.Marshal(new MemberId.Marshal()));
/* raft state */
createDurableState(RAFT_MEMBERSHIP_NAME, new RaftMembershipState.Marshal());
createDurableState(RAFT_TERM_NAME, new TermState.Marshal());
createDurableState(RAFT_VOTE_NAME, new VoteState.Marshal(new MemberId.Marshal()));
}
use of org.neo4j.causalclustering.core.state.storage.SimpleFileStorage in project neo4j by neo4j.
the class DumpClusterState method dump.
void dump() throws IOException {
SimpleStorage<MemberId> memberIdStorage = new SimpleFileStorage<>(fs, clusterStateDirectory, CORE_MEMBER_ID_NAME, new Marshal(), NullLogProvider.getInstance());
if (memberIdStorage.exists()) {
MemberId memberId = memberIdStorage.readState();
out.println(CORE_MEMBER_ID_NAME + ": " + memberId);
}
dumpState(LAST_FLUSHED_NAME, new LongIndexMarshal());
dumpState(LOCK_TOKEN_NAME, new ReplicatedLockTokenState.Marshal(new Marshal()));
dumpState(ID_ALLOCATION_NAME, new IdAllocationState.Marshal());
dumpState(SESSION_TRACKER_NAME, new GlobalSessionTrackerState.Marshal(new Marshal()));
/* raft state */
dumpState(RAFT_MEMBERSHIP_NAME, new RaftMembershipState.Marshal());
dumpState(RAFT_TERM_NAME, new TermState.Marshal());
dumpState(RAFT_VOTE_NAME, new VoteState.Marshal(new Marshal()));
}
Aggregations