bbeaudreault commented on code in PR #2038:
URL: https://github.com/apache/hbase/pull/2038#discussion_r1373744967


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFileCleanerChore.java:
##########
@@ -156,140 +156,143 @@ public void cleanupObsoleteMobFiles(Configuration conf, 
TableName table) throws
     // So, if MOB file creation time is greater than this maxTimeToArchive,
     // this will be skipped and won't be archived.
     long maxCreationTimeToArchive = EnvironmentEdgeManager.currentTime() - 
minAgeToArchive;
-    try (final Connection conn = ConnectionFactory.createConnection(conf);
-        final Admin admin = conn.getAdmin();) {
-      TableDescriptor htd = admin.getDescriptor(table);
-      List<ColumnFamilyDescriptor> list = MobUtils.getMobColumnFamilies(htd);
-      if (list.size() == 0) {
-        LOG.info("Skipping non-MOB table [{}]", table);
-        return;
-      } else {
-        LOG.info("Only MOB files whose creation time older than {} will be 
archived, table={}",
-          maxCreationTimeToArchive, table);
-      }
+    TableDescriptor htd = null;
+    try (Admin admin = master.getConnection().getAdmin()) {

Review Comment:
   let's keep the old syntax of:
   ```java
   try ( ... ) {
    // full block
   }
   ```
   So as to minimize the diff. We just need to replace the current 2 calls with 
the one call to `master.getConnection().getAdmin()`



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