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


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/DefaultCompactor.java:
##########
@@ -17,42 +17,45 @@
  */
 package org.apache.hadoop.hbase.regionserver.compactions;
 
+import static 
org.apache.hadoop.hbase.regionserver.DefaultStoreEngine.DEFAULT_COMPACTION_ENABLE_DUAL_FILE_WRITER_KEY;
+import static 
org.apache.hadoop.hbase.regionserver.DefaultStoreEngine.DEFAULT_ENABLE_DUAL_FILE_WRITER;
+
 import java.io.IOException;
 import java.util.List;
 import java.util.function.Consumer;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.regionserver.DualFileWriter;
 import org.apache.hadoop.hbase.regionserver.HStore;
 import org.apache.hadoop.hbase.regionserver.InternalScanner;
-import org.apache.hadoop.hbase.regionserver.StoreFileWriter;
 import org.apache.hadoop.hbase.regionserver.throttle.ThroughputController;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.yetus.audience.InterfaceAudience;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.hbase.thirdparty.com.google.common.collect.Lists;
 
 /**
  * Compact passed set of files. Create an instance and then call
  * {@link #compact(CompactionRequestImpl, ThroughputController, User)}
  */
 @InterfaceAudience.Private
-public class DefaultCompactor extends Compactor<StoreFileWriter> {
-  private static final Logger LOG = 
LoggerFactory.getLogger(DefaultCompactor.class);
+public class DefaultCompactor extends 
AbstractMultiOutputCompactor<DualFileWriter> {
 
   public DefaultCompactor(Configuration conf, HStore store) {
     super(conf, store);
   }
 
-  private final CellSinkFactory<StoreFileWriter> writerFactory =
-    new CellSinkFactory<StoreFileWriter>() {
+  private final CellSinkFactory<DualFileWriter> writerFactory =
+    new CellSinkFactory<DualFileWriter>() {
       @Override
-      public StoreFileWriter createWriter(InternalScanner scanner, FileDetails 
fd,
+      public DualFileWriter createWriter(InternalScanner scanner, FileDetails 
fd,
         boolean shouldDropBehind, boolean major, Consumer<Path> 
writerCreationTracker)
         throws IOException {
-        return DefaultCompactor.this.createWriter(fd, shouldDropBehind, major,
-          writerCreationTracker);
+        boolean enableDualFileWriter = conf.getBoolean(

Review Comment:
   StoreFileWriter is a single file writer. DualFileWriter can write to up to 
two files. It can behaves as a single file writer as well as a dual file 
writer. DualFileWriter extends AbstractMultiFileWriter as 
DateTieredMultiFileWriter and StripeMultiFileWriter do. The relationship type 
between StoreFileWriter and an AbstractMultiFileWriter is composition but not 
inheritance. Thus, they cannot be exchangeable. The store engine code is 
organized this way currently. Changing this organization would be very invasive.



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