2014-01-13 19:52:22 +01:00
|
|
|
cimport options
|
|
|
|
from libc.stdint cimport uint64_t
|
|
|
|
from status cimport Status
|
|
|
|
from libcpp cimport bool as cpp_bool
|
|
|
|
from libcpp.string cimport string
|
|
|
|
from libcpp.vector cimport vector
|
|
|
|
from slice_ cimport Slice
|
|
|
|
from snapshot cimport Snapshot
|
|
|
|
from iterator cimport Iterator
|
|
|
|
|
|
|
|
cdef extern from "rocksdb/write_batch.h" namespace "rocksdb":
|
|
|
|
cdef cppclass WriteBatch:
|
2014-01-17 20:06:17 +01:00
|
|
|
WriteBatch() nogil except+
|
|
|
|
WriteBatch(string) nogil except+
|
|
|
|
void Put(const Slice&, const Slice&) nogil except+
|
|
|
|
void Merge(const Slice&, const Slice&) nogil except+
|
|
|
|
void Delete(const Slice&) nogil except+
|
|
|
|
void PutLogData(const Slice&) nogil except+
|
|
|
|
void Clear() nogil except+
|
|
|
|
string Data() nogil except+
|
|
|
|
int Count() nogil const
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
cdef extern from "rocksdb/db.h" namespace "rocksdb":
|
|
|
|
ctypedef uint64_t SequenceNumber
|
|
|
|
|
|
|
|
cdef struct LiveFileMetaData:
|
|
|
|
string name
|
|
|
|
int level
|
|
|
|
size_t size
|
|
|
|
string smallestkey
|
|
|
|
string largestkey
|
|
|
|
SequenceNumber smallest_seqno
|
|
|
|
SequenceNumber largest_seqno
|
|
|
|
|
|
|
|
cdef cppclass Range:
|
|
|
|
Range(const Slice&, const Slice&)
|
|
|
|
|
|
|
|
cdef cppclass DB:
|
|
|
|
Status Put(
|
|
|
|
const options.WriteOptions&,
|
|
|
|
const Slice&,
|
2014-01-17 20:06:17 +01:00
|
|
|
const Slice&) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
Status Delete(
|
|
|
|
const options.WriteOptions&,
|
2014-01-17 20:06:17 +01:00
|
|
|
const Slice&) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
Status Merge(
|
|
|
|
const options.WriteOptions&,
|
|
|
|
const Slice&,
|
2014-01-17 20:06:17 +01:00
|
|
|
const Slice&) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
Status Write(
|
|
|
|
const options.WriteOptions&,
|
2014-01-17 20:06:17 +01:00
|
|
|
WriteBatch*) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
Status Get(
|
|
|
|
const options.ReadOptions&,
|
|
|
|
const Slice&,
|
2014-01-17 20:06:17 +01:00
|
|
|
string*) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
vector[Status] MultiGet(
|
|
|
|
const options.ReadOptions&,
|
|
|
|
const vector[Slice]&,
|
2014-01-17 20:06:17 +01:00
|
|
|
vector[string]*) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
cpp_bool KeyMayExist(
|
|
|
|
const options.ReadOptions&,
|
|
|
|
Slice&,
|
|
|
|
string*,
|
2014-01-17 20:06:17 +01:00
|
|
|
cpp_bool*) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
cpp_bool KeyMayExist(
|
|
|
|
const options.ReadOptions&,
|
|
|
|
Slice&,
|
2014-01-17 20:06:17 +01:00
|
|
|
string*) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
Iterator* NewIterator(
|
2014-01-17 20:06:17 +01:00
|
|
|
const options.ReadOptions&) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
2014-01-17 20:06:17 +01:00
|
|
|
const Snapshot* GetSnapshot() nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
2014-01-17 20:06:17 +01:00
|
|
|
void ReleaseSnapshot(const Snapshot*) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
cpp_bool GetProperty(
|
|
|
|
const Slice&,
|
2014-01-17 20:06:17 +01:00
|
|
|
string*) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
void GetApproximateSizes(
|
|
|
|
const Range*
|
|
|
|
int,
|
2014-01-17 20:06:17 +01:00
|
|
|
uint64_t*) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
void CompactRange(
|
|
|
|
const Slice*,
|
|
|
|
const Slice*,
|
|
|
|
bool,
|
2014-01-17 20:06:17 +01:00
|
|
|
int) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
2014-01-17 20:06:17 +01:00
|
|
|
int NumberLevels() nogil except+
|
|
|
|
int MaxMemCompactionLevel() nogil except+
|
|
|
|
int Level0StopWriteTrigger() nogil except+
|
|
|
|
const string& GetName() nogil except+
|
2014-01-24 17:06:26 +01:00
|
|
|
const options.Options& GetOptions() nogil except+
|
2014-01-17 20:06:17 +01:00
|
|
|
Status Flush(const options.FlushOptions&) nogil except+
|
|
|
|
Status DisableFileDeletions() nogil except+
|
|
|
|
Status EnableFileDeletions() nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
# TODO: Status GetSortedWalFiles(VectorLogPtr& files)
|
|
|
|
# TODO: SequenceNumber GetLatestSequenceNumber()
|
|
|
|
# TODO: Status GetUpdatesSince(
|
|
|
|
# SequenceNumber seq_number,
|
|
|
|
# unique_ptr[TransactionLogIterator]*)
|
|
|
|
|
2014-01-17 20:06:17 +01:00
|
|
|
Status DeleteFile(string) nogil except+
|
|
|
|
void GetLiveFilesMetaData(vector[LiveFileMetaData]*) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
cdef Status DB_Open "rocksdb::DB::Open"(
|
|
|
|
const options.Options&,
|
|
|
|
const string&,
|
2014-01-17 20:06:17 +01:00
|
|
|
DB**) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
cdef Status DB_OpenForReadOnly "rocksdb::DB::OpenForReadOnly"(
|
|
|
|
const options.Options&,
|
|
|
|
const string&,
|
|
|
|
DB**,
|
2014-01-17 20:06:17 +01:00
|
|
|
cpp_bool) nogil except+
|