Class KvFileCompactorFileCache

java.lang.Object
io.datarouter.bytes.kvfile.compact.KvFileCompactorFileCache

public class KvFileCompactorFileCache extends Object
Keeps track of files during a compaction. Can be enhanced with different selection strategies for efficient compaction.
  • Constructor Details

    • KvFileCompactorFileCache

      public KvFileCompactorFileCache(int targetNumFiles, boolean prune, ByteLength readBufferSize, int memoryFanIn, int streamingFanIn, List<BlockfileNameAndSize> files)
  • Method Details

    • numFiles

      public int numFiles()
    • totalSize

      public ByteLength totalSize()
    • add

      public void add(BlockfileNameAndSize file)
    • remove

      public void remove(BlockfileNameAndSize file)
    • hasMoreToMerge

      public boolean hasMoreToMerge()
    • findNextMergePlan

      public Optional<KvFileMergePlan> findNextMergePlan()
    • level

      public static int level(long fileSize)
      Effectively rounds up to an exact power of 2.