Package org.rocksdb
Class CompactionOptions
- java.lang.Object
-
- org.rocksdb.AbstractNativeReference
-
- org.rocksdb.AbstractImmutableNativeReference
-
- org.rocksdb.RocksObject
-
- org.rocksdb.CompactionOptions
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class CompactionOptions extends RocksObject
CompactionOptions are used inRocksDB.compactFiles(CompactionOptions, ColumnFamilyHandle, List, int, int, CompactionJobInfo)calls.
-
-
Field Summary
-
Fields inherited from class org.rocksdb.RocksObject
nativeHandle_
-
Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_
-
-
Constructor Summary
Constructors Constructor Description CompactionOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompressionTypecompression()Get the compaction output compression type.protected voiddisposeInternal(long handle)intmaxSubcompactions()Get the maximum number of threads that will concurrently perform a compaction job.longoutputFileSizeLimit()Get the compaction output file size limit.CompactionOptionssetCompression(CompressionType compression)Set the compaction output compression type.CompactionOptionssetMaxSubcompactions(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.CompactionOptionssetOutputFileSizeLimit(long outputFileSizeLimit)Compaction will create files of sizeoutputFileSizeLimit().-
Methods inherited from class org.rocksdb.RocksObject
disposeInternal, getNativeHandle
-
Methods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Methods inherited from class org.rocksdb.AbstractNativeReference
dispose, finalize
-
-
-
-
Method Detail
-
compression
public CompressionType compression()
Get the compaction output compression type. SeesetCompression(CompressionType).- Returns:
- the compression type.
-
setCompression
public CompactionOptions setCompression(CompressionType compression)
Set the compaction output compression type. Default: snappy If set toCompressionType.DISABLE_COMPRESSION_OPTION, RocksDB will choose compression type according to theColumnFamilyOptions.compressionType(), taking into account the output level ifColumnFamilyOptions.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. SeesetOutputFileSizeLimit(long).- Returns:
- the file size limit.
-
setOutputFileSizeLimit
public CompactionOptions setOutputFileSizeLimit(long outputFileSizeLimit)
Compaction will create files of sizeoutputFileSizeLimit(). 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 inDBOptions.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:
disposeInternalin classRocksObject
-
-