smiklosovic commented on code in PR #3716:
URL: https://github.com/apache/cassandra/pull/3716#discussion_r1886752375


##########
src/java/org/apache/cassandra/service/StorageService.java:
##########
@@ -487,16 +486,14 @@ public StorageService()
         // use dedicated executor for handling JMX notifications
         super(JMXBroadcastExecutor.executor);
 
-        jmxObjectName = "org.apache.cassandra.db:type=StorageService";
-
         sstablesTracker = new 
SSTablesGlobalTracker(DatabaseDescriptor.getSelectedSSTableFormat());
     }
 
-    public void registerMBeans()
+    protected void registerMBeans()
     {
-        logger.info("Initializing storage service mbean");
-        MBeanWrapper.instance.registerMBean(this, jmxObjectName);
-        MBeanWrapper.instance.registerMBean(StreamManager.instance, 
StreamManager.OBJECT_NAME);
+        logger.debug("Initializing storage service mbean");
+        MBeanWrapper.registerIfNotRegistered(this, MBEAN_NAME);

Review Comment:
   I would go for `maybeRegister`. This "maybe" pattern is prevalent around the 
codebase afaict. 



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