forked from faust-streaming/python-rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request faust-streaming#7 from NightTsarina/options_helper…
…_classes Options helper classes
- Loading branch information
Showing
3 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from libcpp cimport bool as cpp_bool | ||
from libcpp.string cimport string | ||
from libcpp.vector cimport vector | ||
from libcpp.memory cimport unique_ptr | ||
from libc.stdint cimport uint32_t | ||
from .slice_ cimport Slice | ||
|
||
cdef extern from "rocksdb/compaction_filter.h" namespace "rocksdb": | ||
cdef cppclass CompactionFilterContext: | ||
cpp_bool is_full_compaction | ||
cpp_bool is_manual_compaction | ||
|
||
cdef enum ValueType "rocksdb::CompactionFilter::ValueType": | ||
ValueType_kValue "rocksdb::CompactionFilter::ValueType::kValue" | ||
ValueType_kMergeOperand "rocksdb::CompactionFilter::ValueType::kMergeOperand" | ||
ValueType_kBlobIndex "rocksdb::CompactionFilter::ValueType::kBlobIndex" | ||
|
||
cdef enum Decision "rocksdb::CompactionFilter::Decision": | ||
Decision_kKeep "rocksdb::CompactionFilter::Decision::kKeep" | ||
Decision_kRemove "rocksdb::CompactionFilter::Decision::kRemove" | ||
Decision_kChangeValue "rocksdb::CompactionFilter::Decision::kChangeValue" | ||
Decision_kRemoveAndSkipUntil "rocksdb::CompactionFilter::Decision::kRemoveAndSkipUntil" | ||
|
||
cdef enum BlobDecision "rocksdb::CompactionFilter::BlobDecision": | ||
BlobDecision_kKeep "rocksdb::CompactionFilter::BlobDecision::kKeep" | ||
BlobDecision_kChangeValue "rocksdb::CompactionFilter::BlobDecision::kChangeValue" | ||
BlobDecision_kCorruption "rocksdb::CompactionFilter::BlobDecision::kCorruption" | ||
BlobDecision_kIOError "rocksdb::CompactionFilter::BlobDecision::kIOError" | ||
|
||
cdef cppclass Context "rocksdb::CompactionFilter::Context": | ||
cpp_bool is_full_compaction | ||
cpp_bool is_manual_compaction | ||
uint32_t column_family_id | ||
|
||
cdef cppclass CompactionFilter: | ||
cpp_bool Filter(int, const Slice&, | ||
const Slice&, | ||
string*, | ||
cpp_bool*) nogil except+ | ||
cpp_bool FilterMergeOperand(int, const Slice&, | ||
const Slice&) nogil except+ | ||
Decision FilterV2(int level, const Slice&, ValueType, | ||
const Slice&, string*, | ||
string*) | ||
BlobDecision PrepareBlobOutput(const Slice&, | ||
const Slice&, | ||
string*) | ||
cpp_bool IgnoreSnapshots() | ||
const char* Name() | ||
|
||
cdef cppclass CompactionFilterFactory: | ||
unique_ptr[CompactionFilter] CreateCompactionFilter( | ||
const Context&) | ||
const char* Name() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from libcpp.string cimport string | ||
from libc.stdint cimport int32_t | ||
|
||
cdef extern from "rocksdb/concurrent_task_limiter.h" namespace "rocksdb": | ||
cdef cppclass ConcurrentTaskLimiter: | ||
const string& GetName() | ||
void SetMaxOutstandingTask(int32_t) | ||
void ResetMaxOutstandingTask() | ||
int32_t GetOutstandingTask() | ||
|
||
ConcurrentTaskLimiter* NewConcurrentTaskLimiter(const string&, int32_t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters