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


##########
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:
   -Ah, this looks like a bad IntelliJ refactor.-
   
   Hmm. Actually, looking at it again, not sure that makes so much sense. I'll 
have a think about what we might be able to do to make this cleaner, but as 
structured the parent class is going to pass these parameters in either way, 
and I'm not sure it's clearer to ignore those parameters and supply the ones we 
have, even if they'll end up the same.



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