Package org.rocksdb

Class CompactionOptions

All Implemented Interfaces:
AutoCloseable

public class CompactionOptions extends RocksObject
  • Constructor Details

    • CompactionOptions

      public CompactionOptions()
  • Method Details

    • compression

      public CompressionType compression()
      Get the compaction output compression type. See setCompression(CompressionType).
      Returns:
      the compression type.
    • setCompression

      public CompactionOptions setCompression(CompressionType compression)
      Set the compaction output compression type. Default: snappy If set to CompressionType.DISABLE_COMPRESSION_OPTION, RocksDB will choose compression type according to the ColumnFamilyOptions.compressionType(), taking into account the output level if ColumnFamilyOptions.compressionPerLevel() is specified.
      Parameters:
      compression - the compression type to use for compaction output.
      Returns:
      the instance of the current Options.
    • outputFileSizeLimit

      public long outputFileSizeLimit()
      Get the compaction output file size limit. See setOutputFileSizeLimit(long).
      Returns:
      the file size limit.
    • setOutputFileSizeLimit

      public CompactionOptions setOutputFileSizeLimit(long outputFileSizeLimit)
      Compaction will create files of size outputFileSizeLimit(). Default: 2^64-1, which means that compaction will create a single file
      Parameters:
      outputFileSizeLimit - the size limit
      Returns:
      the instance of the current Options.
    • maxSubcompactions

      public int maxSubcompactions()
      Get the maximum number of threads that will concurrently perform a compaction job.
      Returns:
      the maximum number of threads.
    • setMaxSubcompactions

      public CompactionOptions setMaxSubcompactions(int maxSubcompactions)
      This value represents the maximum number of threads that will concurrently perform a compaction job by breaking it into multiple, smaller ones that are run simultaneously. Default: 0 (i.e. no subcompactions) If > 0, it will replace the option in DBOptions.maxSubcompactions() for this compaction.
      Parameters:
      maxSubcompactions - The maximum number of threads that will concurrently perform a compaction job
      Returns:
      the instance of the current Options.
    • disposeInternal

      protected final void disposeInternal(long handle)
      Specified by:
      disposeInternal in class RocksObject