You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/09/06 05:48:00 UTC

[GitHub] [ozone] ChenSammi commented on a diff in pull request #3734: HDDS-7197. Schema V3 RocksDB instance statitics register as metrics collision

ChenSammi commented on code in PR #3734:
URL: https://github.com/apache/ozone/pull/3734#discussion_r963275889


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java:
##########
@@ -58,38 +58,43 @@ public class RDBStore implements DBStore {
   private final RDBCheckpointManager checkPointManager;
   private final String checkpointsParentDir;
   private final RDBMetrics rdbMetrics;
+  private final String dbJmxBeanName;
 
   @VisibleForTesting
   public RDBStore(File dbFile, ManagedDBOptions options,
                   Set<TableConfig> families) throws IOException {
     this(dbFile, options, new ManagedWriteOptions(), families,
-        new CodecRegistry(), false);
+        new CodecRegistry(), false, null);
   }
 
   public RDBStore(File dbFile, ManagedDBOptions dbOptions,
                   ManagedWriteOptions writeOptions, Set<TableConfig> families,
-                  CodecRegistry registry, boolean readOnly)
-      throws IOException {
+                  CodecRegistry registry, boolean readOnly,
+                  String dbJmxBeanNameName) throws IOException {
     Preconditions.checkNotNull(dbFile, "DB file location cannot be null");
     Preconditions.checkNotNull(families);
     Preconditions.checkArgument(!families.isEmpty());
     codecRegistry = registry;
     dbLocation = dbFile;
+    dbJmxBeanName = dbJmxBeanNameName == null ? dbFile.getName() :
+        dbJmxBeanNameName;
 
     try {
       db = RocksDatabase.open(dbFile, dbOptions, writeOptions,
           families, readOnly);
 
       if (dbOptions.statistics() != null) {
         Map<String, String> jmxProperties = new HashMap<>();
-        jmxProperties.put("dbName", dbFile.getName());
+        jmxProperties.put("dbName", dbJmxBeanName);
         statMBeanName = HddsUtils.registerWithJmxProperties(
             "Ozone", "RocksDbStore", jmxProperties,
-            RocksDBStoreMBean.create(dbOptions.statistics(),
-                dbFile.getName()));
+            RocksDBStoreMBean.create(dbOptions.statistics(), dbJmxBeanName));
         if (statMBeanName == null) {
           LOG.warn("jmx registration failed during RocksDB init, db path :{}",
-              dbFile.getAbsolutePath());
+              dbJmxBeanName);
+        } else {
+          LOG.info("jmx registration succeed during RocksDB init, db path :{}",

Review Comment:
   Right, let me change it's level to debug. 



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org