protected final void initMultiWriter(AbstractMultiFileWriter writer, InternalScanner scanner,
    final FileDetails fd, final boolean shouldDropBehind, boolean major,
    Consumer<Path> writerCreationTracker) {
    WriterFactory writerFactory = new WriterFactory() {
      @Override
      public StoreFileWriter createWriter() throws IOException {
        return AbstractMultiOutputCompactor.this.createWriter(fd, shouldDropBehind, major,
          writerCreationTracker);
      }

      @Override
      public StoreFileWriter createWriterWithStoragePolicy(String fileStoragePolicy)
        throws IOException {
        return AbstractMultiOutputCompactor.this.createWriter(fd, shouldDropBehind,
          fileStoragePolicy, major, writerCreationTracker);
      }
    };
    // Prepare multi-writer, and perform the compaction using scanner and writer.
    // It is ok here if storeScanner is null.
    StoreScanner storeScanner = (scanner instanceof StoreScanner) ? (StoreScanner) scanner : null;
    writer.init(storeScanner, writerFactory);
  }
Base class for implementing a Compactor which will generate multiple output files after
compaction.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/AbstractMultiOutputCompactor.java