Commit Graph

209 Commits

Author SHA1 Message Date
fyrz
b08c39e14f [RocksJava] RocksIterator: Assert for valid RocksDB instance & documentation 2014-10-27 23:53:27 +01:00
fyrz
56ef2caaa5 [RocksJava] - Hardening RocksIterator
RocksIterator will sometimes Sigsegv on dispose. Mainly thats related
to dispose order. If the related RocksDB instance is freed beforehand
RocksIterator.dispose() will fail.

Within this commit there is a major change to RocksIterator. RocksIterator
will hold a private reference to the RocksDB instance which created the
RocksIterator. So even if RocksDB is freed in the same GC cycle the
RocksIterator instances will be freed prior to related RocksDB instances.

Another aspect targets the dispose logic if the RocksDB is freed previously
and already gc`ed. On dispose of a RocksIterator the dispose logic will check
if the RocksDB instance points to an initialized DB. If not the dispose logic
will not perform any further action.

The crash can be reproduced by using the related test provided within this
commit.

Related information: This relates to @adamretter`s facebook rocksdb-dev group
post about SigSegv on RocksIterator.dispose().
2014-10-27 23:20:12 +01:00
Yueh-Hsuan Chiang
179c23021e Merge pull request #351 from fyrz/RocksJava_Snapshot_Support
[RocksJava] Support Snapshots
2014-10-27 14:50:22 -07:00
fyrz
679a9671fe RocksJava Fix after MutableCFOptions change. 2014-10-27 21:56:25 +01:00
fyrz
a1bae76c87 Integrated changes due to review bei ankgup87 2014-10-26 13:27:43 +01:00
fyrz
b8ce526487 [RocksJava] Support Snapshots
Summary:
Snapshots integration into RocksJava. Added support for the following functionalities:

- getSnapshot
- releaseSnapshot
- ReadOptions support to set a Snapshot
- ReadOptions support to retrieve Snapshot
- SnapshotTest

Test Plan:
make rocksdbjava
make jtest

Differential Revision: https://reviews.facebook.net/D24801
2014-10-25 11:10:19 +02:00
Yueh-Hsuan Chiang
bc3bc4bc2f Merge pull request #357 from fyrz/JavaTest-Fix
Fix issues introduced by latest Java additions
2014-10-24 17:08:10 -07:00
fyrz
bd4fbaee37 Fixed cross platform build after introducing Java-7 dependencies 2014-10-23 21:10:49 +02:00
fyrz
1eb545721d Fix incorrectly merged Java - Makefile 2014-10-23 21:10:49 +02:00
fyrz
9aa9668a83 [RocksJava] Memtables update to 3.6
- Adjusted HashLinkedList to 3.6.0
- Adjusted SkipList to 3.6.0
- Introduced a memtable test
2014-10-23 21:10:17 +02:00
Adam Retter
a6fb7f312d Fix code review comments raised in https://reviews.facebook.net/D22779 2014-10-21 15:52:28 +01:00
Adam Retter
c63494fb61 Tests for ComparatorOptions, Comparator and DirectComparator, and by
proxy we also exercise Slice and DirectSlice
2014-10-21 15:52:27 +01:00
Adam Retter
5e25274110 Fix code style problems identified by lint 2014-10-21 15:52:27 +01:00
Adam Retter
25641bfc9c Fix to memory dealocation when creating a slice from a byte buffer 2014-10-21 15:52:27 +01:00
Adam Retter
fc12cb83f2 Add locking to comparator jni callback methods which must be thread-safe 2014-10-21 15:52:27 +01:00
Adam Retter
d6fe8dacc8 Feature - Implement Java API for Comparator and Slice. Allows use of
either byte[] or DirectByteBuffer for accessing underlying data.
2014-10-21 15:52:27 +01:00
fyrz
bafbc23baa Filters getting disposed by System.gc before EOL
Previous to this commit Filters passed as parameters to the
BlockTableConfig are disposed before they should be disposed.

Further Smart pointer usage was corrected.

Java holds now the smart pointer to the FilterPolicy correctly
and cares about freeing underlying c++ structures.
2014-10-15 20:59:25 +02:00
fyrz
1b97934a2c Options correction 2014-10-14 07:33:57 +02:00
fyrz
ee28f431d0 With the last commit a Test was accidentally disabled. This commit solves this. 2014-10-13 21:12:42 +02:00
fyrz
18004d2f20 [RocksJava] Column family support
This commit includes the support for the following functionalities:

 - Single Get/Put operations
 - WriteBatch operations
 - Single iterator functionality
 - Open database with column families
 - Open database with column families Read/Only
 - Create column family
 - Drop column family
 - Properties of column families
 - Listing of column families
 - Fully backwards comptabile implementation
 - Multi Iterator support
 - MultiGet
 - KeyMayExist
 - Option to create missing column families on open

In addition there is are two new Tests:

 - Test of ColumnFamily functionality
 - Test of Read only feature to open subsets of column families
 - Basic test to test the KeyMayExist feature

What is not supported currently using RocksJava:

 - Custom ColumnFamilyOptions

The following targets work as expected:

 - make rocksdbjava
 - make jtest

Test environment: Ubuntu 14.04(LTS, x64), Java 1.7.0_65(OpenJDK IcedTea 2.5.2), g++ 4.8.2, kernel 3.13.0-35-generix
2014-10-13 10:34:52 +02:00
Yueh-Hsuan Chiang
5908d08a0b Merge pull request #336 from fyrz/32BitRocksJavaBug
32 Bit RocksJava Fix for overflowing jlongs
2014-10-12 19:48:54 -07:00
fyrz
4f5a687254 32-Bit RocksJava resolution for jlong overflows
Summary:
This pull request solves the jlong overflow problem on 32-Bit machines as described in https://github.com/facebook/rocksdb/issues/278:

1. There is a new org.rocksdb.test.PlatformRandomHelper to assist in getting random values. For 32 Bit the getLong method is overriden by xpromaches code above. For 64 Bit it behaves as is.
2. The detection should be cross-platform (Windows is supported though it is not ported completely yet).
3. Every JNI method which sets jlong values must check if the value fits into size_t. If it overflows size_t a InvalidArgument Status object will be returned. If its ok a OK Status will be returned.
4. Setters which have this check will throw a RocksDBException if its no OK Status.

Additionally some other parts of code were corrected using the wrong type casts.

Test Plan:
make rocksdbjava
make jtest

Differential Revision: https://reviews.facebook.net/D24531
2014-10-12 22:42:18 +02:00
fyrz
16d2ebdbcf Minor adjustment to prevent two warnings 2014-10-12 22:41:59 +02:00
fyrz
70294c9114 JavaDoc improvements on RocksJava
Added some more documentation improvements and readability
improvements.
2014-10-12 22:41:59 +02:00
fyrz
ced6129574 Improved JavaDoc 2014-10-07 22:21:34 +02:00
fyrz
5e43155b3f RocksJava should support not only BlockBased Bloomfilter 2014-10-07 22:21:34 +02:00
fyrz
4f272408c5 RocksJava Makefile includes incorrect paths to version.h 2014-10-07 20:43:04 +02:00
ankgup87
daab6dc511 Merge pull request #318 from criccomini/master
Build RocksDB JNI cross-platform fat jar
2014-10-07 09:53:20 -07:00
Chris Riccomini
1e5a52815b update release readme 2014-10-06 08:24:51 -07:00
Chris Riccomini
2a4d6e7960 merge master to resolve merge conflicts 2014-10-06 08:22:55 -07:00
fyrz
22c64be439 Cross platform fix for Java benchmark shell script. 2014-10-05 10:46:55 +02:00
ankgup87
fcd13a77ad Merge pull request #334 from fyrz/JavaDoc-Cleanup
JavaDoc fixes & enhancements RocksJava
2014-10-03 14:47:30 -07:00
fyrz
05204bb119 Lint changes 2014-10-03 21:43:47 +02:00
fyrz
da8ff9ff89 Fixed Findbugs issues
- BackupableDB missing call to super.finalize(major)
- WriteBatchTest inefficient String usage(minor)
- RocksDB local dead variable store(medium)
2014-10-03 12:20:40 +02:00
fyrz
a5757ff3c2 Listing of changes
- JavaDoc readability of RocksObject JavaDoc
- JavaDoc improvements BlockBasedTableConfig, GenericRateLimiterConfig, RocksDB
- JavaDoc improvements MemTableConfig
- JavaDoc improvements RocksObject
- JavaDoc improvements GenericRateLimiterConfig
- JavaDoc improvements ReadOptions
- JavaDoc improvements RateLimiterConfig
- JavaDoc improvements RestoreOptions
- JavaDoc improvements RestoreBackupableDB
- JavaDoc improvements BlockBasedTableConfig
- JavaDoc improvements Options
- JavaDoc improvements BackupableDB and BackupableDBOptions
2014-10-03 11:59:54 +02:00
Yueh-Hsuan Chiang
df3373fbf7 [Java] Fix compile error on DbBenchmark.java
Summary:
Fix compile error on DbBenchmark.java

Test Plan:
make rocksdbjava
make jdb_bench
2014-10-03 02:14:43 -07:00
Yueh-Hsuan Chiang
0e516a75da Fix lint errors in java/rocksjni/options.cc
Summary:
Fix lint errors in java/rocksjni/options.cc

Test Plan:
make rocksdbjava
2014-10-03 00:10:58 -07:00
Chris Riccomini
e869fc6a88 remove proper javadoc directory 2014-10-02 15:46:49 -07:00
Chris Riccomini
99744e0c4b bump version to 3.6 2014-10-02 14:59:20 -07:00
Chris Riccomini
45d526e226 singular javadoc directory 2014-10-02 14:57:18 -07:00
Chris Riccomini
378f321da2 merge master to resolve merge conflicts 2014-10-02 14:52:10 -07:00
Chris Riccomini
c832f1644a add not about updating pom version and rename pom to be unversioned 2014-10-02 14:42:49 -07:00
Chris Riccomini
2d72f7807f update release docs in java 2014-10-02 14:26:52 -07:00
Chris Riccomini
2e80124982 add javadoc and sources targets for sonatype 2014-10-02 13:57:54 -07:00
Chris Riccomini
df08a2d03c add single rocksdbjni pom 2014-10-02 13:47:07 -07:00
Chris Riccomini
fd2545c80a add maven publication target and instructions 2014-10-02 13:29:47 -07:00
fyrz
0173541778 FilterTest 2014-10-02 21:17:48 +02:00
fyrz
d410b39d59 BlockBasedTableConfig Filter policy support RocksJava
As proposed by yhchiang the filter can now be set in Java for
a BlockBasedTableConfig instance.
2014-10-02 21:17:48 +02:00
Chris Riccomini
d0916f452f add major minor micro version to java jars 2014-10-02 11:07:45 -07:00
fyrz
b3343fdeac resolution for java build problem introduced by 5ec53f3edf 2014-10-02 09:25:07 +02:00