rocksdb/java/rocksjni
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
..
backupablejni.cc [Java] Add purgeOldBackups API 2014-08-14 10:58:09 -07:00
env.cc [Java] Add basic Java binding for rocksdb::Env. 2014-06-05 17:09:25 -07:00
filter.cc RocksJava should support not only BlockBased Bloomfilter 2014-10-07 22:21:34 +02:00
iterator.cc [Java] Generalize dis-own native handle and refine dispose framework. 2014-05-28 18:16:29 -07:00
memtablejni.cc 32-Bit RocksJava resolution for jlong overflows 2014-10-12 22:42:18 +02:00
options.cc 32-Bit RocksJava resolution for jlong overflows 2014-10-12 22:42:18 +02:00
portal.h 32-Bit RocksJava resolution for jlong overflows 2014-10-12 22:42:18 +02:00
ratelimiterjni.cc 32-Bit RocksJava resolution for jlong overflows 2014-10-12 22:42:18 +02:00
restorejni.cc 32-Bit RocksJava resolution for jlong overflows 2014-10-12 22:42:18 +02:00
rocksjni.cc 32-Bit RocksJava resolution for jlong overflows 2014-10-12 22:42:18 +02:00
statistics.cc Adding iterator JNI binding 2014-04-19 03:26:22 -07:00
table.cc BlockBasedTableConfig Filter policy support RocksJava 2014-10-02 21:17:48 +02:00
write_batch.cc 32-Bit RocksJava resolution for jlong overflows 2014-10-12 22:42:18 +02:00