aweisberg commented on code in PR #1951:
URL: https://github.com/apache/cassandra/pull/1951#discussion_r1014483290


##########
src/java/org/apache/cassandra/service/accord/AccordCommandStores.java:
##########
@@ -23,36 +23,45 @@
 import accord.api.Agent;
 import accord.api.DataStore;
 import accord.api.ProgressLog;
+import accord.local.AsyncCommandStores;
 import accord.local.CommandStore;
-import accord.local.CommandStores;
 import accord.local.Node;
+import accord.local.NodeTimeService;
 import org.apache.cassandra.concurrent.ExecutorFactory;
 import org.apache.cassandra.utils.ExecutorUtils;
 
-public class AccordCommandStores extends CommandStores
+public class AccordCommandStores extends AsyncCommandStores
 {
     private final ExecutorService[] executors;
 
     public AccordCommandStores(int numShards, Node node, Agent agent, 
DataStore store,
                                ProgressLog.Factory progressLogFactory)
     {
-        super(numShards, node, agent, store, progressLogFactory);
-        this.executors = new ExecutorService[numShards];
-        for (int i=0; i<numShards; i++)
-        {
-            executors[i] = 
ExecutorFactory.Global.executorFactory().sequential(CommandStore.class.getSimpleName()
 + '[' + node + ':' + i + ']');
-        }
+        this(numShards, node, agent, store, progressLogFactory, 
executors(node, numShards));
     }
 
-    @Override
-    protected CommandStore createCommandStore(int generation, int index, int 
numShards, Node node, Agent agent, DataStore store, ProgressLog.Factory 
progressLogFactory, CommandStore.RangesForEpoch rangesForEpoch)
+    private AccordCommandStores(int numShards, NodeTimeService time, Agent 
agent, DataStore store,
+                                ProgressLog.Factory progressLogFactory, 
ExecutorService[] executors)
+    {
+        super(numShards, time, agent, store, progressLogFactory,
+              (id, generation, index, numShards1, node1, agent1, store1, 
progressLogFactory1, rangesForEpoch)
+                -> new AccordCommandStore(id, generation, index, numShards1, 
node1, agent1, store1, progressLogFactory1, rangesForEpoch, executors[index]));

Review Comment:
   It's more that the interface defined by Accord supplies the factory with 
things it maybe doesn't need. It's a minor nit.



-- 
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]

Reply via email to