JeetKunDoug commented on code in PR #2318:
URL: https://github.com/apache/cassandra/pull/2318#discussion_r1202747897
##########
src/java/org/apache/cassandra/utils/MBeanWrapper.java:
##########
@@ -36,23 +42,36 @@
*/
public interface MBeanWrapper
{
- static final Logger logger = LoggerFactory.getLogger(MBeanWrapper.class);
+ Logger logger = LoggerFactory.getLogger(MBeanWrapper.class);
- static final MBeanWrapper instance = create();
+ MBeanWrapper instance = create();
static MBeanWrapper create()
+ {
+ // If we're running in the in-jvm dtest environment, always use the
delegating
+ // mbean wrapper even if we start off with no-op, so it can be
switched later
+ if (IS_IN_JVM_DTEST.getBoolean())
+ return new DelegatingMbeanWrapper(getmBeanWrapper());
+
+ return getmBeanWrapper();
+ }
+
+ static MBeanWrapper getmBeanWrapper()
{
if (ORG_APACHE_CASSANDRA_DISABLE_MBEAN_REGISTRATION.getBoolean())
return new NoOpMBeanWrapper();
String klass = MBEAN_REGISTRATION_CLASS.getString();
if (klass == null)
- return new PlatformMBeanWrapper();
+ if (IS_IN_JVM_DTEST.getBoolean())
Review Comment:
After discussion, we've decided to just add all of the missing
single-statement curly braces to this class across all branches as it's really
confusing without them at this point.
--
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]