wchevreuil commented on code in PR #5545:
URL: https://github.com/apache/hbase/pull/5545#discussion_r1411894932


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java:
##########
@@ -135,11 +136,17 @@ public static List<StoreFileScanner> 
getScannersForStoreFiles(Collection<HStoreF
     for (HStoreFile file : files) {
       // The sort function needs metadata so we need to open reader first 
before sorting the list.
       file.initReader();
-      sortedFiles.add(file);
+      if (onlyLatestVersion) {
+        if (file.hasLatestVersion()) {
+          sortedFiles.add(file);
+        }
+      } else {
+        sortedFiles.add(file);
+      }
     }
     boolean succ = false;
     try {
-      for (int i = 0, n = files.size(); i < n; i++) {
+      for (int i = 0, n = files.size(); i < n && !sortedFiles.isEmpty(); i++) {

Review Comment:
   Then iterate the sortedFiles directly. What happens if sortedFiles is not 
empty, but files > sortedFiles? Won't you get a NPE on lines #153/155?



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DualFileStoreEngine.java:
##########
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import java.io.IOException;
+import java.util.List;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.CellComparator;
+import org.apache.hadoop.hbase.regionserver.compactions.CompactionContext;
+import org.apache.hadoop.hbase.regionserver.compactions.DualFileCompactor;
+import 
org.apache.hadoop.hbase.regionserver.compactions.ExploringCompactionPolicy;
+import 
org.apache.hadoop.hbase.regionserver.compactions.RatioBasedCompactionPolicy;
+import org.apache.hadoop.hbase.regionserver.throttle.ThroughputController;
+import org.apache.hadoop.hbase.security.User;
+import org.apache.hadoop.hbase.util.ReflectionUtils;
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * HBASE-25972 This store engine allows us to store data in two files,
+ * one for the latest put cells and the other for the rest of the cells (i.e.,
+ * older put cells and delete markers).
+ */
[email protected]
+public class DualFileStoreEngine extends StoreEngine<DefaultStoreFlusher,

Review Comment:
   Like @bbeaudreault explained. We can avoid code duplication with a little 
refactoring on DefaultStoreEngine. As we would already need to change it a bit 
to avoid code duplication anyways.
   
   > Or perhaps its fine as is because it would be great to get this ported 
till 2.5 release line?
   
   We may allow that on the brackport for 2.5 only, but I don't think this 
would justify adding such technical debit in master branch.



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