bdeggleston commented on a change in pull request #1:
URL: https://github.com/apache/cassandra-accord/pull/1#discussion_r840837228
##########
File path: accord-core/src/main/java/accord/local/Node.java
##########
@@ -91,19 +86,69 @@ public static int numCommandShards()
private final Map<TxnId, CompletionStage<Result>> coordinating = new
ConcurrentHashMap<>();
private final Set<TxnId> pendingRecovery = Collections.newSetFromMap(new
ConcurrentHashMap<>());
- public Node(Id id, Topology cluster, MessageSink messageSink, Random
random, LongSupplier nowSupplier,
+ public Node(Id id, MessageSink messageSink, ConfigurationService
configService, LongSupplier nowSupplier,
Supplier<Store> dataSupplier, Agent agent, Scheduler
scheduler, CommandStore.Factory commandStoreFactory)
{
this.id = id;
- this.cluster = cluster;
- this.random = random;
this.agent = agent;
- this.now = new AtomicReference<>(new
Timestamp(nowSupplier.getAsLong(), 0, id));
this.messageSink = messageSink;
+ this.configService = configService;
+ this.topology = new TopologyManager(id, configService::reportEpoch);
+ Topology topology = configService.currentTopology();
+ this.now = new AtomicReference<>(new Timestamp(topology.epoch(),
nowSupplier.getAsLong(), 0, id));
this.nowSupplier = nowSupplier;
this.scheduler = scheduler;
- this.commandStores = new CommandStores(numCommandShards(), id,
this::uniqueNow, agent, dataSupplier.get(), commandStoreFactory);
- this.commandStores.updateTopology(cluster.forNode(id));
+ this.commandStores = new CommandStores(numCommandShards(),
+ id,
Review comment:
heh, I prefer the former since I find it easier to read :). Anyway,
topology-integration refactoring reduced the number of commands to make it a
one liner
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]