VladRodionov commented on a change in pull request #623: HBASE-22749: 
Distributed MOB compactions
URL: https://github.com/apache/hbase/pull/623#discussion_r335753132
 
 

 ##########
 File path: hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java
 ##########
 @@ -513,6 +471,40 @@ public static void removeMobFiles(Configuration conf, 
FileSystem fs, TableName t
         storeFiles);
   }
 
+  /**
+   * Archives the mob files.
+   * @param conf The current configuration.
+   * @param tableName The table name.
+   * @param family The name of the column family.
+   * @param storeFiles The files to be archived.
+   * @throws IOException
+   */
+  public static void removeMobFiles(Configuration conf, TableName tableName,
+    byte[] family, List<Path> storeFiles) throws IOException {
+
+    if (storeFiles.size() == 0) {
+      // nothing to remove
+      LOG.debug("Skipping archiving old MOB file: collection is empty");
+      return;
+    }
+    Path mobTableDir = FSUtils.getTableDir(MobUtils.getMobHome(conf), 
tableName);
+    FileSystem fs = storeFiles.get(0).getFileSystem(conf);
+    Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, 
getMobRegionInfo(tableName),
+      mobTableDir, family);
+
+    for (Path p: storeFiles) {
+      Path archiveFilePath = new Path(storeArchiveDir, p.getName());
+      if (fs.exists(archiveFilePath)) {
+        LOG.info(" MOB Cleaner skip archiving: " + p);
 
 Review comment:
   Fixed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to