2014-11-09 20:08:35 +01:00
|
|
|
NATIVE_JAVA_CLASSES = org.rocksdb.AbstractComparator\
|
|
|
|
org.rocksdb.AbstractSlice\
|
|
|
|
org.rocksdb.BackupableDB\
|
|
|
|
org.rocksdb.BackupableDBOptions\
|
|
|
|
org.rocksdb.BlockBasedTableConfig\
|
|
|
|
org.rocksdb.BloomFilter\
|
2014-11-21 21:57:32 +01:00
|
|
|
org.rocksdb.Checkpoint\
|
2014-11-09 20:08:35 +01:00
|
|
|
org.rocksdb.ColumnFamilyHandle\
|
2014-10-31 23:39:14 +01:00
|
|
|
org.rocksdb.ColumnFamilyOptions\
|
2014-11-09 20:08:35 +01:00
|
|
|
org.rocksdb.Comparator\
|
|
|
|
org.rocksdb.ComparatorOptions\
|
|
|
|
org.rocksdb.DBOptions\
|
|
|
|
org.rocksdb.DirectComparator\
|
|
|
|
org.rocksdb.DirectSlice\
|
2014-11-09 20:09:39 +01:00
|
|
|
org.rocksdb.FlushOptions\
|
2014-11-09 20:08:35 +01:00
|
|
|
org.rocksdb.Filter\
|
|
|
|
org.rocksdb.GenericRateLimiterConfig\
|
|
|
|
org.rocksdb.HashLinkedListMemTableConfig\
|
|
|
|
org.rocksdb.HashSkipListMemTableConfig\
|
|
|
|
org.rocksdb.MergeOperator\
|
|
|
|
org.rocksdb.Options\
|
|
|
|
org.rocksdb.PlainTableConfig\
|
|
|
|
org.rocksdb.ReadOptions\
|
|
|
|
org.rocksdb.RestoreBackupableDB\
|
|
|
|
org.rocksdb.RestoreOptions\
|
|
|
|
org.rocksdb.RocksDB\
|
|
|
|
org.rocksdb.RocksEnv\
|
|
|
|
org.rocksdb.RocksIterator\
|
|
|
|
org.rocksdb.SkipListMemTableConfig\
|
|
|
|
org.rocksdb.Slice\
|
|
|
|
org.rocksdb.Statistics\
|
|
|
|
org.rocksdb.VectorMemTableConfig\
|
|
|
|
org.rocksdb.StringAppendOperator\
|
|
|
|
org.rocksdb.WriteBatch\
|
|
|
|
org.rocksdb.WriteBatch.Handler\
|
2014-11-02 01:08:41 +01:00
|
|
|
org.rocksdb.test.WriteBatchInternal\
|
|
|
|
org.rocksdb.test.WriteBatchTest\
|
2014-11-11 18:59:04 +01:00
|
|
|
org.rocksdb.WriteOptions\
|
2015-01-03 15:52:07 +01:00
|
|
|
org.rocksdb.WriteBatchWithIndex\
|
|
|
|
org.rocksdb.WBWIRocksIterator
|
2014-05-14 07:22:21 +02:00
|
|
|
|
2014-10-07 20:43:04 +02:00
|
|
|
ROCKSDB_MAJOR = $(shell egrep "ROCKSDB_MAJOR.[0-9]" ../include/rocksdb/version.h | cut -d ' ' -f 3)
|
|
|
|
ROCKSDB_MINOR = $(shell egrep "ROCKSDB_MINOR.[0-9]" ../include/rocksdb/version.h | cut -d ' ' -f 3)
|
|
|
|
ROCKSDB_PATCH = $(shell egrep "ROCKSDB_PATCH.[0-9]" ../include/rocksdb/version.h | cut -d ' ' -f 3)
|
2014-10-02 20:07:45 +02:00
|
|
|
|
Add a jni library for rocksdb which supports Open, Get, Put, and Close.
Summary:
This diff contains a simple jni library for rocksdb which supports open, get,
put and closeusing default options (including Options, ReadOptions, and
WriteOptions.) In the usual case, Java developers can use the c++ rocksdb
library in the way similar to the following:
RocksDB db = RocksDB.open(path_to_db);
...
db.put("hello".getBytes(), "world".getBytes();
byte[] value = db.get("hello".getBytes());
...
db.close();
Specifically, this diff has the following major classes:
* RocksDB: a Java wrapper class which forwards the operations
from the java side to c++ rocksdb library.
* RocksDBException: ncapsulates the error of an operation.
This exception type is used to describe an internal error from
the c++ rocksdb library.
This diff also include a simple java sample code calling c++ rocksdb library.
To build the rocksdb jni library, simply run make jni, and make jtest will try to
build and run the sample code.
Note that if the rocksdb is not built with the default glibc that Java uses,
java will try to load the wrong glibc during the run time. As a result,
the sample code might not work properly during the run time.
Test Plan:
* make jni
* make jtest
Reviewers: haobo, dhruba, sdong, igor, ljin
Reviewed By: dhruba
CC: leveldb, xjin
Differential Revision: https://reviews.facebook.net/D17109
2014-03-28 22:19:21 +01:00
|
|
|
NATIVE_INCLUDE = ./include
|
2014-09-26 22:57:12 +02:00
|
|
|
ARCH := $(shell getconf LONG_BIT)
|
2014-10-02 20:07:45 +02:00
|
|
|
ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux$(ARCH).jar
|
2014-09-26 22:57:12 +02:00
|
|
|
ifeq ($(PLATFORM), OS_MACOSX)
|
2014-10-02 20:07:45 +02:00
|
|
|
ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-osx.jar
|
2014-09-26 22:57:12 +02:00
|
|
|
endif
|
Add a jni library for rocksdb which supports Open, Get, Put, and Close.
Summary:
This diff contains a simple jni library for rocksdb which supports open, get,
put and closeusing default options (including Options, ReadOptions, and
WriteOptions.) In the usual case, Java developers can use the c++ rocksdb
library in the way similar to the following:
RocksDB db = RocksDB.open(path_to_db);
...
db.put("hello".getBytes(), "world".getBytes();
byte[] value = db.get("hello".getBytes());
...
db.close();
Specifically, this diff has the following major classes:
* RocksDB: a Java wrapper class which forwards the operations
from the java side to c++ rocksdb library.
* RocksDBException: ncapsulates the error of an operation.
This exception type is used to describe an internal error from
the c++ rocksdb library.
This diff also include a simple java sample code calling c++ rocksdb library.
To build the rocksdb jni library, simply run make jni, and make jtest will try to
build and run the sample code.
Note that if the rocksdb is not built with the default glibc that Java uses,
java will try to load the wrong glibc during the run time. As a result,
the sample code might not work properly during the run time.
Test Plan:
* make jni
* make jtest
Reviewers: haobo, dhruba, sdong, igor, ljin
Reviewed By: dhruba
CC: leveldb, xjin
Differential Revision: https://reviews.facebook.net/D17109
2014-03-28 22:19:21 +01:00
|
|
|
|
2014-11-15 23:03:32 +01:00
|
|
|
JAVA_TESTS = org.rocksdb.test.BackupableDBOptionsTest\
|
|
|
|
org.rocksdb.test.BackupableDBTest\
|
2014-11-02 01:08:41 +01:00
|
|
|
org.rocksdb.test.BlockBasedTableConfigTest\
|
2014-11-25 23:08:53 +01:00
|
|
|
org.rocksdb.test.CheckPointTest\
|
2014-11-02 01:08:41 +01:00
|
|
|
org.rocksdb.test.ColumnFamilyOptionsTest\
|
|
|
|
org.rocksdb.test.ColumnFamilyTest\
|
|
|
|
org.rocksdb.test.ComparatorOptionsTest\
|
|
|
|
org.rocksdb.test.ComparatorTest\
|
|
|
|
org.rocksdb.test.DBOptionsTest\
|
|
|
|
org.rocksdb.test.DirectComparatorTest\
|
2014-12-10 00:37:08 +01:00
|
|
|
org.rocksdb.test.DirectSliceTest\
|
2014-11-15 12:37:51 +01:00
|
|
|
org.rocksdb.test.EnvironmentTest\
|
2014-11-02 01:08:41 +01:00
|
|
|
org.rocksdb.test.FilterTest\
|
|
|
|
org.rocksdb.test.FlushTest\
|
2014-11-14 23:40:20 +01:00
|
|
|
org.rocksdb.test.InfoLogLevelTest\
|
2014-11-02 01:08:41 +01:00
|
|
|
org.rocksdb.test.KeyMayExistTest\
|
|
|
|
org.rocksdb.test.MemTableTest\
|
|
|
|
org.rocksdb.test.MergeTest\
|
|
|
|
org.rocksdb.test.MixedOptionsTest\
|
|
|
|
org.rocksdb.test.OptionsTest\
|
|
|
|
org.rocksdb.test.PlainTableConfigTest\
|
|
|
|
org.rocksdb.test.ReadOnlyTest\
|
|
|
|
org.rocksdb.test.ReadOptionsTest\
|
2014-11-07 23:31:38 +01:00
|
|
|
org.rocksdb.test.RocksDBTest\
|
2014-11-07 14:38:21 +01:00
|
|
|
org.rocksdb.test.RocksEnvTest\
|
2014-11-02 01:08:41 +01:00
|
|
|
org.rocksdb.test.RocksIteratorTest\
|
2014-11-15 12:37:51 +01:00
|
|
|
org.rocksdb.test.SizeUnitTest\
|
2014-12-10 00:37:08 +01:00
|
|
|
org.rocksdb.test.SliceTest\
|
2014-11-02 01:08:41 +01:00
|
|
|
org.rocksdb.test.SnapshotTest\
|
|
|
|
org.rocksdb.test.StatisticsCollectorTest\
|
2014-11-13 22:27:58 +01:00
|
|
|
org.rocksdb.test.WriteBatchHandlerTest\
|
2014-11-02 01:08:41 +01:00
|
|
|
org.rocksdb.test.WriteBatchTest\
|
2014-11-03 09:59:52 +01:00
|
|
|
org.rocksdb.test.WriteOptionsTest\
|
2014-12-19 16:29:16 +01:00
|
|
|
org.rocksdb.test.WriteBatchWithIndexTest
|
2014-11-02 01:08:41 +01:00
|
|
|
|
|
|
|
JAVA_TEST_LIBDIR = ./test-libs/
|
|
|
|
JAVA_JUNIT_JAR = $(JAVA_TEST_LIBDIR)junit-4.12-beta-2.jar
|
|
|
|
JAVA_HAMCR_JAR = $(JAVA_TEST_LIBDIR)hamcrest-core-1.3.jar
|
|
|
|
JAVA_MOCKITO_JAR = $(JAVA_TEST_LIBDIR)mockito-all-1.9.5.jar
|
|
|
|
JAVA_CGLIB_JAR = $(JAVA_TEST_LIBDIR)cglib-2.2.2.jar
|
|
|
|
JAVA_ASSERTJ_JAR = $(JAVA_TEST_LIBDIR)assertj-core-1.7.0.jar
|
|
|
|
JAVA_TESTCLASSPATH = $(ROCKSDB_JAR):$(JAVA_JUNIT_JAR):$(JAVA_HAMCR_JAR):$(JAVA_MOCKITO_JAR):$(JAVA_CGLIB_JAR):$(JAVA_ASSERTJ_JAR):.:./*
|
|
|
|
|
Add a jni library for rocksdb which supports Open, Get, Put, and Close.
Summary:
This diff contains a simple jni library for rocksdb which supports open, get,
put and closeusing default options (including Options, ReadOptions, and
WriteOptions.) In the usual case, Java developers can use the c++ rocksdb
library in the way similar to the following:
RocksDB db = RocksDB.open(path_to_db);
...
db.put("hello".getBytes(), "world".getBytes();
byte[] value = db.get("hello".getBytes());
...
db.close();
Specifically, this diff has the following major classes:
* RocksDB: a Java wrapper class which forwards the operations
from the java side to c++ rocksdb library.
* RocksDBException: ncapsulates the error of an operation.
This exception type is used to describe an internal error from
the c++ rocksdb library.
This diff also include a simple java sample code calling c++ rocksdb library.
To build the rocksdb jni library, simply run make jni, and make jtest will try to
build and run the sample code.
Note that if the rocksdb is not built with the default glibc that Java uses,
java will try to load the wrong glibc during the run time. As a result,
the sample code might not work properly during the run time.
Test Plan:
* make jni
* make jtest
Reviewers: haobo, dhruba, sdong, igor, ljin
Reviewed By: dhruba
CC: leveldb, xjin
Differential Revision: https://reviews.facebook.net/D17109
2014-03-28 22:19:21 +01:00
|
|
|
clean:
|
|
|
|
-find . -name "*.class" -exec rm {} \;
|
2014-11-19 21:15:01 +01:00
|
|
|
rm -rf include/*
|
2014-10-03 00:46:49 +02:00
|
|
|
rm -rf javadoc/*
|
2014-11-02 01:08:41 +01:00
|
|
|
rm -rf test-libs/
|
2014-11-19 21:15:01 +01:00
|
|
|
rm -rf target
|
2014-11-26 19:07:06 +01:00
|
|
|
rm -rf librocksdbjni*
|
2014-11-21 23:49:31 +01:00
|
|
|
rm -f rocksdbjni*
|
2014-11-19 21:15:01 +01:00
|
|
|
|
Add a jni library for rocksdb which supports Open, Get, Put, and Close.
Summary:
This diff contains a simple jni library for rocksdb which supports open, get,
put and closeusing default options (including Options, ReadOptions, and
WriteOptions.) In the usual case, Java developers can use the c++ rocksdb
library in the way similar to the following:
RocksDB db = RocksDB.open(path_to_db);
...
db.put("hello".getBytes(), "world".getBytes();
byte[] value = db.get("hello".getBytes());
...
db.close();
Specifically, this diff has the following major classes:
* RocksDB: a Java wrapper class which forwards the operations
from the java side to c++ rocksdb library.
* RocksDBException: ncapsulates the error of an operation.
This exception type is used to describe an internal error from
the c++ rocksdb library.
This diff also include a simple java sample code calling c++ rocksdb library.
To build the rocksdb jni library, simply run make jni, and make jtest will try to
build and run the sample code.
Note that if the rocksdb is not built with the default glibc that Java uses,
java will try to load the wrong glibc during the run time. As a result,
the sample code might not work properly during the run time.
Test Plan:
* make jni
* make jtest
Reviewers: haobo, dhruba, sdong, igor, ljin
Reviewed By: dhruba
CC: leveldb, xjin
Differential Revision: https://reviews.facebook.net/D17109
2014-03-28 22:19:21 +01:00
|
|
|
|
2014-10-02 22:57:54 +02:00
|
|
|
javadocs:
|
2014-11-02 01:08:41 +01:00
|
|
|
mkdir -p javadoc; javadoc -d javadoc -sourcepath . -subpackages org -exclude org.rocksdb.test
|
2014-10-02 22:57:54 +02:00
|
|
|
|
2014-11-19 21:21:21 +01:00
|
|
|
javalib: java javadocs
|
|
|
|
|
|
|
|
java: resolve_test_deps
|
2014-04-30 20:54:02 +02:00
|
|
|
javac org/rocksdb/util/*.java org/rocksdb/*.java
|
2014-11-11 18:59:04 +01:00
|
|
|
javac -cp $(JAVA_TESTCLASSPATH) org/rocksdb/test/*.java
|
2014-06-21 08:18:25 +02:00
|
|
|
@cp ../HISTORY.md ./HISTORY-CPP.md
|
|
|
|
@rm -f ./HISTORY-CPP.md
|
Add a jni library for rocksdb which supports Open, Get, Put, and Close.
Summary:
This diff contains a simple jni library for rocksdb which supports open, get,
put and closeusing default options (including Options, ReadOptions, and
WriteOptions.) In the usual case, Java developers can use the c++ rocksdb
library in the way similar to the following:
RocksDB db = RocksDB.open(path_to_db);
...
db.put("hello".getBytes(), "world".getBytes();
byte[] value = db.get("hello".getBytes());
...
db.close();
Specifically, this diff has the following major classes:
* RocksDB: a Java wrapper class which forwards the operations
from the java side to c++ rocksdb library.
* RocksDBException: ncapsulates the error of an operation.
This exception type is used to describe an internal error from
the c++ rocksdb library.
This diff also include a simple java sample code calling c++ rocksdb library.
To build the rocksdb jni library, simply run make jni, and make jtest will try to
build and run the sample code.
Note that if the rocksdb is not built with the default glibc that Java uses,
java will try to load the wrong glibc during the run time. As a result,
the sample code might not work properly during the run time.
Test Plan:
* make jni
* make jtest
Reviewers: haobo, dhruba, sdong, igor, ljin
Reviewed By: dhruba
CC: leveldb, xjin
Differential Revision: https://reviews.facebook.net/D17109
2014-03-28 22:19:21 +01:00
|
|
|
javah -d $(NATIVE_INCLUDE) -jni $(NATIVE_JAVA_CLASSES)
|
|
|
|
|
2014-04-09 09:48:20 +02:00
|
|
|
sample: java
|
Add a jni library for rocksdb which supports Open, Get, Put, and Close.
Summary:
This diff contains a simple jni library for rocksdb which supports open, get,
put and closeusing default options (including Options, ReadOptions, and
WriteOptions.) In the usual case, Java developers can use the c++ rocksdb
library in the way similar to the following:
RocksDB db = RocksDB.open(path_to_db);
...
db.put("hello".getBytes(), "world".getBytes();
byte[] value = db.get("hello".getBytes());
...
db.close();
Specifically, this diff has the following major classes:
* RocksDB: a Java wrapper class which forwards the operations
from the java side to c++ rocksdb library.
* RocksDBException: ncapsulates the error of an operation.
This exception type is used to describe an internal error from
the c++ rocksdb library.
This diff also include a simple java sample code calling c++ rocksdb library.
To build the rocksdb jni library, simply run make jni, and make jtest will try to
build and run the sample code.
Note that if the rocksdb is not built with the default glibc that Java uses,
java will try to load the wrong glibc during the run time. As a result,
the sample code might not work properly during the run time.
Test Plan:
* make jni
* make jtest
Reviewers: haobo, dhruba, sdong, igor, ljin
Reviewed By: dhruba
CC: leveldb, xjin
Differential Revision: https://reviews.facebook.net/D17109
2014-03-28 22:19:21 +01:00
|
|
|
javac -cp $(ROCKSDB_JAR) RocksDBSample.java
|
2014-04-02 01:59:05 +02:00
|
|
|
@rm -rf /tmp/rocksdbjni
|
|
|
|
@rm -rf /tmp/rocksdbjni_not_found
|
2014-04-17 06:38:33 +02:00
|
|
|
java -ea -Djava.library.path=.:../ -cp ".:./*" -Xcheck:jni RocksDBSample /tmp/rocksdbjni
|
2014-04-02 01:59:05 +02:00
|
|
|
@rm -rf /tmp/rocksdbjni
|
|
|
|
@rm -rf /tmp/rocksdbjni_not_found
|
2014-04-02 22:14:55 +02:00
|
|
|
|
2014-11-08 18:58:35 +01:00
|
|
|
column_family_sample: java
|
|
|
|
javac -cp $(ROCKSDB_JAR) RocksDBColumnFamilySample.java
|
|
|
|
@rm -rf /tmp/rocksdbjni
|
|
|
|
java -ea -Djava.library.path=.:../ -cp ".:./*" -Xcheck:jni RocksDBColumnFamilySample /tmp/rocksdbjni
|
|
|
|
@rm -rf /tmp/rocksdbjni
|
|
|
|
|
2014-11-02 01:08:41 +01:00
|
|
|
resolve_test_deps:
|
|
|
|
mkdir -p "$(JAVA_TEST_LIBDIR)"
|
2014-11-07 14:38:21 +01:00
|
|
|
test -s "$(JAVA_JUNIT_JAR)" || curl -k -L -o $(JAVA_JUNIT_JAR) http://search.maven.org/remotecontent?filepath=junit/junit/4.12-beta-2/junit-4.12-beta-2.jar
|
|
|
|
test -s "$(JAVA_HAMCR_JAR)" || curl -k -L -o $(JAVA_HAMCR_JAR) http://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
|
|
|
|
test -s "$(JAVA_MOCKITO_JAR)" || curl -k -L -o "$(JAVA_MOCKITO_JAR)" http://search.maven.org/remotecontent?filepath=org/mockito/mockito-all/1.9.5/mockito-all-1.9.5.jar
|
|
|
|
test -s "$(JAVA_CGLIB_JAR)" || curl -k -L -o "$(JAVA_CGLIB_JAR)" http://search.maven.org/remotecontent?filepath=cglib/cglib/2.2.2/cglib-2.2.2.jar
|
|
|
|
test -s "$(JAVA_ASSERTJ_JAR)" || curl -k -L -o "$(JAVA_ASSERTJ_JAR)" http://central.maven.org/maven2/org/assertj/assertj-core/1.7.0/assertj-core-1.7.0.jar
|
2014-11-02 01:08:41 +01:00
|
|
|
|
|
|
|
test: java resolve_test_deps
|
2014-11-15 12:37:51 +01:00
|
|
|
java -ea -Xcheck:jni -Djava.library.path=.:../ -cp "$(JAVA_TESTCLASSPATH)" org.rocksdb.test.RocksJunitRunner $(JAVA_TESTS)
|
2014-04-09 09:48:20 +02:00
|
|
|
|
|
|
|
db_bench: java
|
|
|
|
javac org/rocksdb/benchmark/*.java
|