These are chat archives for atomix/atomix
@kuujo you had previously mentioned that "Each primitive has a distinct Raft session" I took this to mean that if you had a primitive with a unique name that you would continue to use that distinct Raft session, as long as the session had not been closed, every time you used the builder to retrieve the primitive. So a call like the following would reuse the session and only open a new one if none currently existed
AtomicCounter atomicCounter = atomix.atomicCounterBuilder("AtomicCounterName-ABC-123") .withProtocol( MultiRaftProtocol.builder(DATA_RAFT_PARTITION_GROUP) .withMaxRetries(multiRaftProtocolConfig.getMaxRetries()) .withRetryDelay(multiRaftProtocolConfig.getRetryDelay()) .withReadConsistency(multiRaftProtocolConfig.getReadConsistency()) .withCommunicationStrategy(multiRaftProtocolConfig.getCommunicationStrategy()) .build() ).build();
While testing this I think each call to the block above, using the same name, will continue to open new raft sessions. In order to properly close all AtomicCounters with the name "AtomicCounterName-ABC-123" I would need to track each reference and close each one individually instead of calling close on a single instance of AtomcCounter with the name "AtomicCounterName-ABC-123". Is my understanding correct here?
atomix.getLeaderElection(...)will always return the same instance/session.
build()returns a new instance is:
build()suggests a new instance is built
LeaderElectionwithout implicitly affecting other portions of the application.
buildSingleton()method to the
PrimtiveBuilderto return a singleton instance with a shared session