voltdb / jleveldb Goto Github PK
View Code? Open in Web Editor NEWBSD-licensed Java bindings for LevelDB
BSD-licensed Java bindings for LevelDB
jleveldb A bare bones JNI wrapper for the LevelDB project (http://code.google.com/p/leveldb/) This project wraps the C-interface to LevelDB with JNI code, exposing it to Java. It is missing about 3 functions that have callbacks or other weirdness I haven't gotten to yet. It comes with pre-built LevelDB libraries for OSX 10.6+ and Linux 2.6 (both 64-bit). It comes with a makefile that should product a JNI library and a jarfile for those platforms. It also comes with inadequate, but easily expanded, test-coverage. Note that the libleveldb-linux.a library was built with the -fPIC flag. It shouldn't be too much work to update the makefile to build for other platforms or architectures. The following make targets are useful: make clean make make test It uses Java longs to represent pointers in native code. This is a hack that seems to work reasonably well. Be aware that if you pass the wrong kind of structure for a given parameter, your process will likely crash. I plan to build a java layer on top of this that more closely mirrors the native LevelDB API when I get a chance. This code likely has some bugs yet, as the test coverage is thin. Reproducers and pull requests welcome. Here is some sample code: =========== NativeInterface ni = new NativeInterface(); long options = ni.leveldb_options_create(); ni.leveldb_options_set_create_if_missing(options, true); long writeoptions = ni.leveldb_writeoptions_create(); long readoptions = ni.leveldb_readoptions_create(); long db = ni.leveldb_open(options, "testfile.leveldb"); ni.leveldb_put(db, writeoptions, "key".getBytes(), "value".getBytes()); byte[] value = ni.leveldb_get(db, readoptions, "key".getBytes()); assertTrue(Arrays.equals("value".getBytes(), value)); ni.leveldb_close(db); ni.leveldb_destroy_db(options, "testfile.leveldb"); ni.leveldb_options_destroy(options); ni.leveldb_readoptions_destroy(readoptions); ni.leveldb_writeoptions_destroy(writeoptions); ===========
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.