Comments (13)
The rocksdb C++ api is far more richer than the leveldb api. But we have (sadly) failed to enhance the C api in the same way. If you would like to bring the C api in par with C++ api, that will be a great contribution to the rocksdb github repo.
from rocksdb.
Great then, I am on it :)
from rocksdb.
@sepeth Feel free to change leveldb_* in c.h
to rocksdb_* and send us a pull request :)
from rocksdb.
👍
@sepeth if you want to some hands for your contributions, I could be with you. :)
from rocksdb.
@igorcanadi I sent it :)
@junyoungKim Great :) I started with renames, and I will keep c-api branch updated in my fork as I progress. We can continue from there, I think.
from rocksdb.
@sepeth ok, I've checked your branch for the jobs. Lets think about how we can implement it in a best way.
from rocksdb.
I find that rocksdb's C API is much the same with leveldb's C API, I have written a python leveldb binding based on its C API before(https://github.com/forhappy/cpy-leveldb), so I can make it for rocksdb much easier, I'm on it too ;-).
from rocksdb.
Hi @sepeth have you considered other methods for wrapping ?
For example Cython has great capabilities to wrap c++ code and the generated code works under python2 and python3
Only drawback, it generates code for cPython only. For a more 'interpreter-independent' way you should also check out CFFI. The 'wrap-performance' on pypy is outstanding (because the JIT knows of the C-functions and types and calls them directly) and on cPython comparable to ctypes.
However I don't know the status of CFFI for Jython/IronPython, but if you really target this two interpreters you should also check if they support ctypes properly.
from rocksdb.
Hello @sepeth , Any idea on when the python bindings for RocksDB will be available?
from rocksdb.
@ramanala hello, hardest part of it is to complete C api, I believe. I've been doing somethings on that part (but some other things in my life kept me away from doing it), and still stuck with merge operator. In the mean time, I am playing with rocksdb from python. It seems easy to do with ctypes.
@stephan-hof Thank you. I am also considering CFFI, beside ctypes. and also pypy seems to suggest CFFI too.
from rocksdb.
Hi guys, I also started python bindings for rocksdb.
Code here https://github.com/stephan-hof/pyrocksdb and the docs here http://pyrocksdb.readthedocs.org/
I'm using cython to wrap the C++ bindings directly.
I know this makes it impossible to use them under pypy, but I had a couple of reasons to do it
- Experience with Cython (was using it to wrap other c++ libraries).
- Cython has good capabilities to wrap C++, for example automatic exception conversion.
- No dependencies on rocksdb C-API. As mentioned above the C-API lacks behind the features of the C++ driver and it seems to me the new features are implemented in C++ first.
The driver is still not complete yet, for example a python prefix_extractor is not possible, but the basic operations are already possible. Everything mentioned in the docs (like merge operator) should work.
Give it a try, I would be happy for everybody who would like to join the development.
from rocksdb.
Closing the issue since it's stale. Thank you everybody for contributing to python bindings!
from rocksdb.
Has someone created a CFFI extension yet?
from rocksdb.
Related Issues (20)
- Feature Request: Graceful upgrade
- There is an error when I am compilling rocksDB version above 8.10.0 with zenFS 2.1.4 HOT 1
- Doc bug: CustomFilterPolicy example
- Feature request: check if prefix exists without seeking HOT 5
- intermittent segfault with small database with multiple column families HOT 2
- coredump when trying to repair database
- Rocksdb crash when upgrade from 6.6.3 to 8.0 HOT 1
- ZSTD_TrainDictionary runs even when the compression is set to kNoCompression for a given level HOT 4
- can I reuse a rocksdb writebatch by calling rocksdb_writebatch_clear?
- TtlDb.java doesn't set default column family handle HOT 4
- Discussion: requiring minimum of C++20 HOT 10
- Enable/Disable CacheEntryRoleOptions::chargedfor CacheEntryRole DataBlock is not supported on Ubuntu only HOT 5
- rocksdb Open may read over 160MB from an sst file in one Read request to file system
- Windows GitHub Action build of RocksDB failing silently without marking job as failed HOT 1
- Memory Leak with rocksdb version 6.6.3 ? HOT 6
- function scoped static variable destruct early and cause a crash when used with ASAN HOT 5
- Java release for 9.0 HOT 5
- deadlock caused by calling SetOptions() in OnStallConditionsChanged()
- Service internal error: RocksDB open error: IO error: No such file or directory: while unlink() file:
- Make it possible to not install the static-library. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocksdb.