Skip to content

Commit

Permalink
Porting to rocksdb.
Browse files Browse the repository at this point in the history
  • Loading branch information
chirino committed Nov 18, 2013
1 parent e50e268 commit 636a762
Show file tree
Hide file tree
Showing 65 changed files with 376 additions and 435 deletions.
76 changes: 3 additions & 73 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,6 @@
# [LevelDBJNI](https://github.com/fusesource/leveldbjni)
# [rocksdbjni](https://github.com/fusesource/rocksdbjni)

## [leveldbjni 1.7][1_7], released 2013-05-13

* Fixes issues #27: SIGSEGV when creating iterator after DB was closed
* fixe the mac os error on osgi container
* Fix linking under mingw. Native functions not exported into dll correctly
* attach generated sources
* Add windows makefile (no autotools)

## [leveldbjni 1.6.1][1_6_1], released 2013-04-16
[1_6_1]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/leveldbjni/leveldbjni-all/1.6.1

* Rebuilding as the uber jar for the 'leveldb-all' module did not actually include the changes in the 1.6 release.

## [leveldbjni 1.6][1_6], released 2013-02-06
[1_6]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/leveldbjni/leveldbjni-all/1.6

* Added OSGi meta-data to the -all jar
* Optimize for when values are not found.
* Fixed Memory leak with pooled memory
* Fixed DBIterator.hasPrev() causes invalid memory access exception

## [leveldbjni 1.5][1_5], released 2012-10-31
[1_5]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/leveldbjni/leveldbjni-all/1.5

* Switch to leveldb-api version 0.5
* Update to leveldb 1.9 code

## [leveldbjni 1.4][1_4], released 2012-10-31
[1_4]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/leveldbjni/leveldbjni-all/1.4

* Switch to leveldb-api version 0.4
* Checking the results of autotool chain into the source tree so that folks building don't have to have the autotools installed.
* Support suspending the background compaction thread.

## [leveldbjni 1.3][1_3], released 2012-09-24
[1_3]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/leveldbjni/leveldbjni-all/1.3

* Make Util.link work on windows too.
* Expose the CreateHardLinkW windows API call.
* Added Windows LevelDB Support
* Update to hawtjni 1.6.
* Support the db.compactRange method to force compaction of the leveldb files.
* Fixed bug need to get leveldbjni workin on the Zing JVM

## [leveldbjni 1.2][1_2], released 2012-02-27
[1_2]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/leveldbjni/leveldbjni-all/1.2

* Document how to use the memory pools.
* Fixes issue #6 Support using a memory pool to reduce native memory allocation overhead.
* Update leveldb, hawtjni, and leveldb-api versions.
* Store the version in the factory class.
* Added a release guide.

## [leveldbjni 1.1][1_1], released 2011-09-29
[1_1]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/leveldbjni/leveldbjni-all/1.1

* the all module needs at least one java file so that it produces a javadoc and src.zip
* Try to load the native lib when the JniDBFactory class is loaded.
* Fixes issue #1 : Bug on NativeBuffer offset
* Switch the license from CDDL to the New BSD license to match the license used in the leveldb project.
* Add the sonatype snapshot repo since that's where the leveldb-api is at currently.
* Pickup updates in the api module.
* Updating build instructions.
* implement repair and destroy.
* api updated
* Cleaner java package structure. We only need to expose one public class now since we are using the org.iq80.leveldb abstract api.
* Refactored so that the main user API is the abstract API defined in 'org.iq80.leveldb.api' package.

## [leveldbjni 1.0][1_0], released 2011-08-08
[1_0]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/leveldbjni/leveldbjni/1.0
## [rocksdbjni 1.0][1_0], unreleased
[1_0]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/rocksdbjni/rocksdbjni/1.0

* Initial Release
* OS X Intel 32 and 64 bit support
* Linux Intel 32 and 64 bit support

This file was deleted.

44 changes: 22 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,32 @@
<version>1.9</version>
</parent>

<groupId>org.fusesource.leveldbjni</groupId>
<artifactId>leveldbjni-project</artifactId>
<groupId>org.fusesource.rocksdbjni</groupId>
<artifactId>rocksdbjni-project</artifactId>
<version>99-master-SNAPSHOT</version>
<packaging>pom</packaging>

<name>${project.artifactId}</name>
<description>leveldbjni is a jni library for accessing leveldb.</description>
<description>rocksdbjni is a jni library for accessing rocksdb.</description>

<properties>
<forge-project-id>leveldbjni</forge-project-id>
<forge-project-id-uc>LEVELDBJNI</forge-project-id-uc>
<forge-project-id>rocksdbjni</forge-project-id>
<forge-project-id-uc>rocksdbjni</forge-project-id-uc>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hawtjni-version>1.9</hawtjni-version>
<leveldb-api-version>0.6</leveldb-api-version>
</properties>

<modules>
<module>leveldbjni</module>
<module>rocksdbjni</module>
</modules>

<url>http://${forge-project-id}.fusesource.org</url>
<inceptionYear>2009</inceptionYear>

<issueManagement>
<system>github</system>
<url>https://github.com/fusesource/leveldbjni/issues</url>
<url>https://github.com/fusesource/rocksdbjni/issues</url>
</issueManagement>

<mailingLists>
Expand All @@ -89,9 +89,9 @@
</licenses>

<scm>
<connection>scm:git:git://github.com/fusesource/leveldbjni.git</connection>
<developerConnection>scm:git:[email protected]:fusesource/leveldbjni.git</developerConnection>
<url>https://github.com/fusesource/leveldbjni</url>
<connection>scm:git:git://github.com/fusesource/rocksdbjni.git</connection>
<developerConnection>scm:git:[email protected]:fusesource/rocksdbjni.git</developerConnection>
<url>https://github.com/fusesource/rocksdbjni</url>
</scm>

<distributionManagement>
Expand Down Expand Up @@ -243,39 +243,39 @@
<profile>
<id>full</id>
<modules>
<module>leveldbjni-osx</module>
<module>leveldbjni-linux32</module>
<module>leveldbjni-linux64</module>
<module>leveldbjni-win32</module>
<module>leveldbjni-win64</module>
<module>leveldbjni-all</module>
<module>rocksdbjni-osx</module>
<module>rocksdbjni-linux32</module>
<module>rocksdbjni-linux64</module>
<module>rocksdbjni-win32</module>
<module>rocksdbjni-win64</module>
<module>rocksdbjni-all</module>
</modules>
</profile>

<profile>
<id>all</id>
<modules>
<module>leveldbjni-all</module>
<module>rocksdbjni-all</module>
</modules>
</profile>
<profile>
<id>osx</id>
<modules>
<module>leveldbjni-osx</module>
<module>rocksdbjni-osx</module>
</modules>
</profile>

<profile>
<id>linux32</id>
<modules>
<module>leveldbjni-linux32</module>
<module>rocksdbjni-linux32</module>
</modules>
</profile>

<profile>
<id>linux64</id>
<modules>
<module>leveldbjni-linux64</module>
<module>rocksdbjni-linux64</module>
</modules>
</profile>

Expand All @@ -285,7 +285,7 @@
<skipAutogen>true</skipAutogen>
</properties>
<modules>
<module>leveldbjni-win32</module>
<module>rocksdbjni-win32</module>
</modules>
</profile>

Expand All @@ -295,7 +295,7 @@
<skipAutogen>true</skipAutogen>
</properties>
<modules>
<module>leveldbjni-win64</module>
<module>rocksdbjni-win64</module>
</modules>
</profile>

Expand Down
54 changes: 27 additions & 27 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# LevelDB JNI
# RocksDB JNI

## Description

LevelDB JNI gives you a Java interface to the
[LevelDB](http://code.google.com/p/leveldb/) C++ library
RocksDB JNI gives you a Java interface to the
[RocksDB](http://code.google.com/p/rocksdb/) C++ library
which is a fast key-value storage library written at Google
that provides an ordered mapping from string keys to string values..

# Getting the JAR

Just add the following jar to your java project:
[leveldbjni-all-1.7.jar](http://repo2.maven.org/maven2/org/fusesource/leveldbjni/leveldbjni-all/1.7/leveldbjni-all-1.7.jar)
[rocksdbjni-all-1.7.jar](http://repo2.maven.org/maven2/org/fusesource/rocksdbjni/rocksdbjni-all/1.7/rocksdbjni-all-1.7.jar)

## Using as a Maven Dependency

You just nee to add the following dependency to your Maven pom.

<dependencies>
<dependency>
<groupId>org.fusesource.leveldbjni</groupId>
<artifactId>leveldbjni-all</artifactId>
<groupId>org.fusesource.rocksdbjni</groupId>
<artifactId>rocksdbjni-all</artifactId>
<version>1.7</version>
</dependency>
</dependencies>
Expand All @@ -28,8 +28,8 @@ You just nee to add the following dependency to your Maven pom.

Recommended Package imports:

import org.iq80.leveldb.*;
import static org.fusesource.leveldbjni.JniDBFactory.*;
import org.iq80.rocksdb.*;
import static org.fusesource.rocksdbjni.JniDBFactory.*;
import java.io.*;

Opening and closing the database.
Expand Down Expand Up @@ -134,7 +134,7 @@ Getting approximate sizes.

Getting database status.

String stats = db.getProperty("leveldb.stats");
String stats = db.getProperty("rocksdb.stats");
System.out.println(stats);

Getting informational log messages.
Expand Down Expand Up @@ -185,20 +185,20 @@ The following worked for me on:

### Build Procedure

Then download the snappy, leveldb, and leveldbjni project source code:
Then download the snappy, rocksdb, and rocksdbjni project source code:

wget http://snappy.googlecode.com/files/snappy-1.0.5.tar.gz
tar -zxvf snappy-1.0.5.tar.gz
git clone git://github.com/chirino/leveldb.git
git clone git://github.com/fusesource/leveldbjni.git
git clone git://github.com/chirino/rocksdb.git
git clone git://github.com/fusesource/rocksdbjni.git
export SNAPPY_HOME=`cd snappy-1.0.5; pwd`
export LEVELDB_HOME=`cd leveldb; pwd`
export LEVELDBJNI_HOME=`cd leveldbjni; pwd`
export ROCKSDB_HOME=`cd rocksdb; pwd`
export rocksdbjni_HOME=`cd rocksdbjni; pwd`

<!-- In cygwin that would be
export SNAPPY_HOME=$(cygpath -w `cd snappy-1.0.5; pwd`)
export LEVELDB_HOME=$(cygpath -w `cd leveldb; pwd`)
export LEVELDBJNI_HOME=$(cygpath -w `cd leveldbjni; pwd`)
export ROCKSDB_HOME=$(cygpath -w `cd rocksdb; pwd`)
export rocksdbjni_HOME=$(cygpath -w `cd rocksdbjni; pwd`)
-->

Compile the snappy project. This produces a static library.
Expand All @@ -207,18 +207,18 @@ Compile the snappy project. This produces a static library.
./configure --disable-shared --with-pic
make

Patch and Compile the leveldb project. This produces a static library.
Patch and Compile the rocksdb project. This produces a static library.

cd ${LEVELDB_HOME}
cd ${ROCKSDB_HOME}
export LIBRARY_PATH=${SNAPPY_HOME}
export C_INCLUDE_PATH=${LIBRARY_PATH}
export CPLUS_INCLUDE_PATH=${LIBRARY_PATH}
git apply ../leveldbjni/leveldb.patch
make libleveldb.a
git apply ../rocksdbjni/rocksdb.patch
make librocksdb.a

Now use maven to build the leveldbjni project.
Now use maven to build the rocksdbjni project.

cd ${LEVELDBJNI_HOME}
cd ${rocksdbjni_HOME}
mvn clean install -P download -P ${platform}

Replace ${platform} with one of the following platform identifiers (depending on the platform your building on):
Expand All @@ -230,15 +230,15 @@ Replace ${platform} with one of the following platform identifiers (depending on
* win64

If your platform does not have the right auto-tools levels available
just copy the `leveldbjni-${version}-SNAPSHOT-native-src.zip` artifact
just copy the `rocksdbjni-${version}-SNAPSHOT-native-src.zip` artifact
from a platform the does have the tools available then add the
following argument to your maven build:

-Dnative-src-url=file:leveldbjni-${verision}-SNAPSHOT-native-src.zip
-Dnative-src-url=file:rocksdbjni-${verision}-SNAPSHOT-native-src.zip

### Build Results

* `leveldbjni/target/leveldbjni-${version}.jar` : The java class file to the library.
* `leveldbjni/target/leveldbjni-${version}-native-src.zip` : A GNU style source project which you can use to build the native library on other systems.
* `leveldbjni-${platform}/target/leveldbjni-${platform}-${version}.jar` : A jar file containing the built native library using your currently platform.
* `rocksdbjni/target/rocksdbjni-${version}.jar` : The java class file to the library.
* `rocksdbjni/target/rocksdbjni-${version}-native-src.zip` : A GNU style source project which you can use to build the native library on other systems.
* `rocksdbjni-${platform}/target/rocksdbjni-${platform}-${version}.jar` : A jar file containing the built native library using your currently platform.

11 changes: 11 additions & 0 deletions release.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#release configuration
#Mon May 13 09:09:05 EDT 2013
scm.tagNameFormat=@{project.artifactId}-@{project.version}
pushChanges=false
scm.url=scm\:git\:[email protected]\:fusesource/rocksdbjni.git
preparationGoals=clean install
remoteTagging=true
scm.commentPrefix=[maven-release-plugin]
exec.additionalArguments=-Prelease -P download,download,swiftmq-client
exec.snapshotReleasePluginAllowed=false
completedPhase=create-backup-poms
Loading

0 comments on commit 636a762

Please sign in to comment.