esteban commented on a change in pull request #1446: HBASE-23723 Ensure MOB 
compaction works in optimized mode after snapshot clone
URL: https://github.com/apache/hbase/pull/1446#discussion_r405699127
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreCompactor.java
 ##########
 @@ -190,34 +192,71 @@ public DefaultMobStoreCompactor(Configuration conf, 
HStore store) {
     // Check if I/O optimized MOB compaction
     if (ioOptimizedMode) {
       if (request.isMajor() && request.getPriority() == HStore.PRIORITY_USER) {
-        Path mobDir =
-            MobUtils.getMobFamilyPath(conf, store.getTableName(), 
store.getColumnFamilyName());
-        List<Path> mobFiles = 
MobUtils.getReferencedMobFiles(request.getFiles(), mobDir);
-        //reset disableIO
-        disableIO.set(Boolean.FALSE);
-        if (mobFiles.size() > 0) {
-          calculateMobLengthMap(mobFiles);
+        try {
+          final SetMultimap<TableName, String> mobRefs = 
request.getFiles().stream()
+              .map(file -> {
+                byte[] value = file.getMetadataValue(HStoreFile.MOB_FILE_REFS);
+                ImmutableSetMultimap.Builder<TableName, String> builder;
+                if (value == null) {
+                  builder = ImmutableSetMultimap.builder();
+                } else {
+                  try {
+                    builder = MobUtils.deserializeMobFileRefs(value);
+                  } catch (RuntimeException exception) {
+                     throw new RuntimeException("failure getting mob 
references for hfile " + file,
+                         exception);
+                  }
+                }
+                return builder;
+              }).reduce((a, b) -> 
a.putAll(b.build())).orElseGet(ImmutableSetMultimap::builder)
+              .build();
+          //reset disableIO
+          disableIO.set(Boolean.FALSE);
 
 Review comment:
   Does it matter if we don't do this in a finally block if we get the RTE from 
above?

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