You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "dcapwell (via GitHub)" <gi...@apache.org> on 2023/01/27 20:20:57 UTC

[GitHub] [cassandra-accord] dcapwell commented on a diff in pull request #28: CASSANDRA-18203: CEP-15: (C*) Improve Burn Tests to include thread scheduling

dcapwell commented on code in PR #28:
URL: https://github.com/apache/cassandra-accord/pull/28#discussion_r1089394273


##########
accord-core/src/main/java/accord/impl/InMemoryCommandStore.java:
##########
@@ -576,15 +576,25 @@ public <T> Future<T> submit(PreLoadContext context, Function<? super SafeCommand
 
         public SingleThread(int id, NodeTimeService time, Agent agent, DataStore store, ProgressLog.Factory progressLogFactory, RangesForEpochHolder rangesForEpoch)
         {
-            super(id);
-            executor = Executors.newSingleThreadExecutor(r -> {
+            this(id, time, agent, store, progressLogFactory, rangesForEpoch, Executors.newSingleThreadExecutor(r -> {
                 Thread thread = new Thread(r);
                 thread.setName(CommandStore.class.getSimpleName() + '[' + time.id() + ']');
                 return thread;
-            });
+            }));
+        }
+
+        private SingleThread(int id, NodeTimeService time, Agent agent, DataStore store, ProgressLog.Factory progressLogFactory, RangesForEpochHolder rangesForEpoch, ExecutorService executor)

Review Comment:
   name may not make sense in this case, 100% cool making a base type such as `ExecutorCommandStore` and have `SingleThread` extend it and use the existing logic to build the single threaded executor



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org