Documentation
¶
Index ¶
- Constants
- func CreateBlockBasedTableOptions(config *RocksDBConfig) *grocksdb.BlockBasedTableOptions
- func CreateOptions(config *RocksDBConfig, mergeOp grocksdb.MergeOperator) *grocksdb.Options
- func CreatePrefixExtractor(prefixLength int) grocksdb.SliceTransform
- func CreateReadOptions(prefixSeek bool, cacheBlocks bool) *grocksdb.ReadOptions
- func LogConfiguration(config *RocksDBConfig)
- type MetaDB
- type RocksDBConfig
Constants ¶
const ( // Default block cache size in bytes DefaultRocksDBBlockCacheSize = 1 << 30 // 1GB // DefaultRocksDBMaxBackgroundJobs is the default number of concurrent // RocksDB background jobs (compactions + flushes) for the lifetime of the DB. DefaultRocksDBMaxBackgroundJobs = 8 )
Variables ¶
This section is empty.
Functions ¶
func CreateBlockBasedTableOptions ¶
func CreateBlockBasedTableOptions(config *RocksDBConfig) *grocksdb.BlockBasedTableOptions
CreateBlockBasedTableOptions creates optimized table options for 4KB values with prefixes
func CreateOptions ¶
func CreateOptions(config *RocksDBConfig, mergeOp grocksdb.MergeOperator) *grocksdb.Options
CreateOptions creates optimized RocksDB options for 4KB values with prefixes
func CreatePrefixExtractor ¶
func CreatePrefixExtractor(prefixLength int) grocksdb.SliceTransform
CreatePrefixExtractor creates a prefix extractor for the given prefix length
func CreateReadOptions ¶
func CreateReadOptions(prefixSeek bool, cacheBlocks bool) *grocksdb.ReadOptions
CreateReadOptions creates optimized read options for prefix-based queries
func LogConfiguration ¶
func LogConfiguration(config *RocksDBConfig)
LogConfiguration logs the RocksDB configuration for debugging
Types ¶
type MetaDB ¶
type MetaDB struct {
// contains filtered or unexported fields
}
func NewMetaDB ¶
func NewMetaDB(diskPath string, ttl int, mergeOp grocksdb.MergeOperator, config *RocksDBConfig) (*MetaDB, error)
NewMetaDB creates a new isolated MetaDB instance with custom configuration. The caller is responsible for calling Close() on the returned instance.
type RocksDBConfig ¶
type RocksDBConfig struct {
// Block cache size in bytes
BlockCacheSize int64
// Write buffer size in bytes
WriteBufferSize int
// Maximum number of write buffers
MaxWriteBufferNumber int
// Minimum write buffers to merge
MinWriteBufferNumberToMerge int
// Total write buffer size limit
DbWriteBufferSize int64
// Block size in bytes
BlockSize int
// Bloom filter bits per key
BloomBitsPerKey int
// Enable statistics collection
EnableStatistics bool
// Target file size base in bytes
TargetFileSizeBase int64
// Maximum background jobs
MaxBackgroundJobs int
// Level0 file number compaction trigger
Level0FileNumCompactionTrigger int
// Level0 slowdown writes trigger
Level0SlowdownWritesTrigger int
// Level0 stop writes trigger
Level0StopWritesTrigger int
}
RocksDBConfig holds all RocksDB-specific configuration parameters
func DefaultRocksDBConfig ¶
func DefaultRocksDBConfig() *RocksDBConfig
DefaultRocksDBConfig returns the default configuration optimized for 4KB values with prefixes