2014-01-13 19:52:22 +01:00
|
|
|
from libcpp cimport bool as cpp_bool
|
|
|
|
from libcpp.string cimport string
|
|
|
|
from libcpp.vector cimport vector
|
|
|
|
from libc.stdint cimport uint64_t
|
2015-08-27 21:45:09 +02:00
|
|
|
from libc.stdint cimport uint32_t
|
2020-09-03 08:52:56 +02:00
|
|
|
from .std_memory cimport shared_ptr
|
|
|
|
from .comparator cimport Comparator
|
|
|
|
from .merge_operator cimport MergeOperator
|
|
|
|
from .logger cimport Logger
|
|
|
|
from .slice_ cimport Slice
|
|
|
|
from .snapshot cimport Snapshot
|
|
|
|
from .slice_transform cimport SliceTransform
|
|
|
|
from .table_factory cimport TableFactory
|
|
|
|
#from .statistics cimport Statistics
|
|
|
|
from .memtablerep cimport MemTableRepFactory
|
|
|
|
from .universal_compaction cimport CompactionOptionsUniversal
|
|
|
|
from .cache cimport Cache
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
cdef extern from "rocksdb/options.h" namespace "rocksdb":
|
2017-04-16 08:13:01 +02:00
|
|
|
cdef cppclass CompressionOptions:
|
|
|
|
int window_bits;
|
|
|
|
int level;
|
|
|
|
int strategy;
|
|
|
|
uint32_t max_dict_bytes
|
|
|
|
CompressionOptions() except +
|
|
|
|
CompressionOptions(int, int, int, int) except +
|
|
|
|
|
2014-04-29 17:46:21 +02:00
|
|
|
ctypedef enum CompactionStyle:
|
|
|
|
kCompactionStyleLevel
|
|
|
|
kCompactionStyleUniversal
|
2017-04-07 18:18:38 +02:00
|
|
|
kCompactionStyleFIFO
|
|
|
|
kCompactionStyleNone
|
2014-04-29 17:46:21 +02:00
|
|
|
|
2014-01-13 19:52:22 +01:00
|
|
|
ctypedef enum CompressionType:
|
|
|
|
kNoCompression
|
|
|
|
kSnappyCompression
|
|
|
|
kZlibCompression
|
|
|
|
kBZip2Compression
|
2015-07-05 13:52:17 +02:00
|
|
|
kLZ4Compression
|
|
|
|
kLZ4HCCompression
|
2017-04-07 18:18:38 +02:00
|
|
|
kXpressCompression
|
|
|
|
kZSTD
|
|
|
|
kZSTDNotFinalCompression
|
|
|
|
kDisableCompressionOption
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
ctypedef enum ReadTier:
|
|
|
|
kReadAllTier
|
|
|
|
kBlockCacheTier
|
|
|
|
|
2017-04-07 18:18:38 +02:00
|
|
|
ctypedef enum CompactionPri:
|
|
|
|
kByCompensatedSize
|
|
|
|
kOldestLargestSeqFirst
|
|
|
|
kOldestSmallestSeqFirst
|
|
|
|
kMinOverlappingRatio
|
|
|
|
|
2018-11-02 19:27:14 +01:00
|
|
|
# This needs to be in _rocksdb.pxd so it will export into python
|
|
|
|
#cpdef enum AccessHint "rocksdb::DBOptions::AccessHint":
|
|
|
|
# NONE,
|
|
|
|
# NORMAL,
|
|
|
|
# SEQUENTIAL,
|
|
|
|
# WILLNEED
|
|
|
|
|
|
|
|
cdef cppclass DBOptions:
|
2014-01-13 19:52:22 +01:00
|
|
|
cpp_bool create_if_missing
|
2018-11-02 19:27:14 +01:00
|
|
|
cpp_bool create_missing_column_families
|
2014-01-13 19:52:22 +01:00
|
|
|
cpp_bool error_if_exists
|
|
|
|
cpp_bool paranoid_checks
|
|
|
|
# TODO: env
|
2014-01-24 17:06:26 +01:00
|
|
|
shared_ptr[Logger] info_log
|
2018-11-02 19:27:14 +01:00
|
|
|
int max_open_files
|
|
|
|
int max_file_opening_threads
|
2020-08-31 11:35:52 +02:00
|
|
|
#shared_ptr[Statistics] statistics
|
2018-11-02 19:27:14 +01:00
|
|
|
cpp_bool use_fsync
|
|
|
|
string db_log_dir
|
|
|
|
string wal_dir
|
|
|
|
uint64_t delete_obsolete_files_period_micros
|
|
|
|
int max_background_jobs
|
|
|
|
int max_background_compactions
|
|
|
|
uint32_t max_subcompactions
|
|
|
|
int max_background_flushes
|
|
|
|
size_t max_log_file_size
|
|
|
|
size_t log_file_time_to_roll
|
|
|
|
size_t keep_log_file_num
|
|
|
|
size_t recycle_log_file_num
|
2020-03-12 20:49:29 +01:00
|
|
|
size_t stats_history_buffer_size
|
2018-11-02 19:27:14 +01:00
|
|
|
uint64_t max_manifest_file_size
|
|
|
|
int table_cache_numshardbits
|
|
|
|
uint64_t WAL_ttl_seconds
|
|
|
|
uint64_t WAL_size_limit_MB
|
|
|
|
size_t manifest_preallocation_size
|
|
|
|
cpp_bool allow_mmap_reads
|
|
|
|
cpp_bool allow_mmap_writes
|
|
|
|
cpp_bool use_direct_reads
|
|
|
|
cpp_bool use_direct_io_for_flush_and_compaction
|
|
|
|
cpp_bool allow_fallocate
|
|
|
|
cpp_bool is_fd_close_on_exec
|
|
|
|
cpp_bool skip_log_error_on_recovery
|
|
|
|
unsigned int stats_dump_period_sec
|
|
|
|
cpp_bool advise_random_on_open
|
|
|
|
size_t db_write_buffer_size
|
|
|
|
# AccessHint access_hint_on_compaction_start
|
|
|
|
cpp_bool use_adaptive_mutex
|
|
|
|
uint64_t bytes_per_sync
|
|
|
|
cpp_bool allow_concurrent_memtable_write
|
|
|
|
cpp_bool enable_write_thread_adaptive_yield
|
|
|
|
shared_ptr[Cache] row_cache
|
2019-04-22 20:46:01 +02:00
|
|
|
void IncreaseParallelism(int) nogil except+
|
2018-11-02 19:27:14 +01:00
|
|
|
|
|
|
|
cdef cppclass ColumnFamilyOptions:
|
|
|
|
ColumnFamilyOptions()
|
|
|
|
ColumnFamilyOptions(const Options& options)
|
|
|
|
const Comparator* comparator
|
|
|
|
shared_ptr[MergeOperator] merge_operator
|
|
|
|
# TODO: compaction_filter
|
|
|
|
# TODO: compaction_filter_factory
|
2014-01-13 19:52:22 +01:00
|
|
|
size_t write_buffer_size
|
|
|
|
int max_write_buffer_number
|
|
|
|
int min_write_buffer_number_to_merge
|
|
|
|
CompressionType compression
|
2017-04-07 18:18:38 +02:00
|
|
|
CompactionPri compaction_pri
|
2014-01-13 19:52:22 +01:00
|
|
|
# TODO: compression_per_level
|
2014-04-01 21:24:18 +02:00
|
|
|
shared_ptr[SliceTransform] prefix_extractor
|
2014-01-13 19:52:22 +01:00
|
|
|
int num_levels
|
|
|
|
int level0_file_num_compaction_trigger
|
|
|
|
int level0_slowdown_writes_trigger
|
|
|
|
int level0_stop_writes_trigger
|
|
|
|
int max_mem_compaction_level
|
2014-10-22 20:58:59 +02:00
|
|
|
uint64_t target_file_size_base
|
2014-01-13 19:52:22 +01:00
|
|
|
int target_file_size_multiplier
|
|
|
|
uint64_t max_bytes_for_level_base
|
2017-04-07 18:18:38 +02:00
|
|
|
double max_bytes_for_level_multiplier
|
2014-01-13 19:52:22 +01:00
|
|
|
vector[int] max_bytes_for_level_multiplier_additional
|
|
|
|
int expanded_compaction_factor
|
|
|
|
int source_compaction_factor
|
|
|
|
int max_grandparent_overlap_factor
|
|
|
|
cpp_bool disableDataSync
|
|
|
|
double soft_rate_limit
|
|
|
|
double hard_rate_limit
|
|
|
|
unsigned int rate_limit_delay_max_milliseconds
|
|
|
|
size_t arena_block_size
|
|
|
|
# TODO: PrepareForBulkLoad()
|
|
|
|
cpp_bool disable_auto_compactions
|
|
|
|
cpp_bool purge_redundant_kvs_while_flush
|
|
|
|
cpp_bool allow_os_buffer
|
2014-04-27 16:39:17 +02:00
|
|
|
cpp_bool verify_checksums_in_compaction
|
2014-04-29 17:46:21 +02:00
|
|
|
CompactionStyle compaction_style
|
|
|
|
CompactionOptionsUniversal compaction_options_universal
|
2014-01-13 19:52:22 +01:00
|
|
|
cpp_bool filter_deletes
|
|
|
|
uint64_t max_sequential_skip_in_iterations
|
2014-04-28 20:32:33 +02:00
|
|
|
shared_ptr[MemTableRepFactory] memtable_factory
|
2014-04-27 19:20:30 +02:00
|
|
|
shared_ptr[TableFactory] table_factory
|
2014-01-13 19:52:22 +01:00
|
|
|
# TODO: table_properties_collectors
|
|
|
|
cpp_bool inplace_update_support
|
|
|
|
size_t inplace_update_num_locks
|
2017-04-07 18:18:38 +02:00
|
|
|
# TODO: remove options source_compaction_factor, max_grandparent_overlap_bytes and expanded_compaction_factor from document
|
2017-04-16 08:13:01 +02:00
|
|
|
uint64_t max_compaction_bytes
|
|
|
|
CompressionOptions compression_opts
|
2020-04-07 14:19:08 +02:00
|
|
|
cpp_bool optimize_filters_for_hits
|
2020-05-18 17:51:27 +02:00
|
|
|
cpp_bool paranoid_file_checks
|
2021-02-16 21:35:11 +01:00
|
|
|
cpp_bool level_compaction_dynamic_level_bytes
|
2018-11-02 19:27:14 +01:00
|
|
|
|
|
|
|
cdef cppclass Options(DBOptions, ColumnFamilyOptions):
|
|
|
|
pass
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
cdef cppclass WriteOptions:
|
|
|
|
cpp_bool sync
|
|
|
|
cpp_bool disableWAL
|
|
|
|
|
|
|
|
cdef cppclass ReadOptions:
|
|
|
|
cpp_bool verify_checksums
|
|
|
|
cpp_bool fill_cache
|
|
|
|
const Snapshot* snapshot
|
|
|
|
ReadTier read_tier
|
|
|
|
|
|
|
|
cdef cppclass FlushOptions:
|
|
|
|
cpp_bool wait
|
2015-08-27 21:45:09 +02:00
|
|
|
|
|
|
|
ctypedef enum BottommostLevelCompaction:
|
|
|
|
blc_skip "rocksdb::BottommostLevelCompaction::kSkip"
|
|
|
|
blc_is_filter "rocksdb::BottommostLevelCompaction::kIfHaveCompactionFilter"
|
|
|
|
blc_force "rocksdb::BottommostLevelCompaction::kForce"
|
|
|
|
|
|
|
|
cdef cppclass CompactRangeOptions:
|
|
|
|
cpp_bool change_level
|
|
|
|
int target_level
|
|
|
|
uint32_t target_path_id
|
|
|
|
BottommostLevelCompaction bottommost_level_compaction
|