chia7712 commented on code in PR #22292:
URL: https://github.com/apache/kafka/pull/22292#discussion_r3254178393


##########
server-common/src/main/java/org/apache/kafka/server/share/persister/DefaultStatePersister.java:
##########
@@ -45,8 +48,29 @@ public class DefaultStatePersister implements Persister {
 
     private static final Logger log = 
LoggerFactory.getLogger(DefaultStatePersister.class);
 
-    public DefaultStatePersister(PersisterStateManager stateManager) {
+    public static DefaultStatePersister instance(KafkaClient client, 
ShareCoordinatorMetadataCacheHelper cacheHelper, Time time, Timer timer) {
+        DefaultStatePersister instance = new DefaultStatePersister(client, 
cacheHelper, time, timer);
+        instance.start();
+        return instance;
+    }
+
+    // Visibility for tests
+    static DefaultStatePersister instance(PersisterStateManager stateManager) {

Review Comment:
   It appears all the passed `stateManager` instances are mocked. Maybe we 
could remove this helper and have the tests use the package-private constructor 
instead?



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

Reply via email to