diff --git a/java/Makefile b/java/Makefile index 9d21b5750..feacb8346 100644 --- a/java/Makefile +++ b/java/Makefile @@ -1,4 +1,4 @@ -NATIVE_JAVA_CLASSES = org.rocksdb.RocksDB org.rocksdb.Options org.rocksdb.WriteBatch org.rocksdb.WriteBatchInternal org.rocksdb.WriteBatchTest org.rocksdb.WriteOptions org.rocksdb.BackupableDB org.rocksdb.BackupableDBOptions org.rocksdb.Statistics org.rocksdb.Iterator org.rocksdb.VectorMemTableConfig org.rocksdb.SkipListMemTableConfig org.rocksdb.HashLinkedListMemTableConfig org.rocksdb.HashSkipListMemTableConfig org.rocksdb.PlainTableConfig org.rocksdb.ReadOptions org.rocksdb.Filter org.rocksdb.BloomFilter +NATIVE_JAVA_CLASSES = org.rocksdb.RocksDB org.rocksdb.Options org.rocksdb.WriteBatch org.rocksdb.WriteBatchInternal org.rocksdb.WriteBatchTest org.rocksdb.WriteOptions org.rocksdb.BackupableDB org.rocksdb.BackupableDBOptions org.rocksdb.Statistics org.rocksdb.RocksIterator org.rocksdb.VectorMemTableConfig org.rocksdb.SkipListMemTableConfig org.rocksdb.HashLinkedListMemTableConfig org.rocksdb.HashSkipListMemTableConfig org.rocksdb.PlainTableConfig org.rocksdb.ReadOptions org.rocksdb.Filter org.rocksdb.BloomFilter NATIVE_INCLUDE = ./include ROCKSDB_JAR = rocksdbjni.jar diff --git a/java/RocksDBSample.java b/java/RocksDBSample.java index 5d11b1aa9..1493977a9 100644 --- a/java/RocksDBSample.java +++ b/java/RocksDBSample.java @@ -186,7 +186,7 @@ public class RocksDBSample { assert(false); //Should never reach here. } - Iterator iterator = db.newIterator(); + RocksIterator iterator = db.newIterator(); boolean seekToFirstPassed = false; for (iterator.seekToFirst(); iterator.isValid(); iterator.next()) { diff --git a/java/org/rocksdb/RocksDB.java b/java/org/rocksdb/RocksDB.java index e92acea27..23dad1dc4 100644 --- a/java/org/rocksdb/RocksDB.java +++ b/java/org/rocksdb/RocksDB.java @@ -311,8 +311,8 @@ public class RocksDB extends RocksObject { * * @return instance of iterator object. */ - public Iterator newIterator() { - return new Iterator(iterator0(nativeHandle_)); + public RocksIterator newIterator() { + return new RocksIterator(iterator0(nativeHandle_)); } @Override protected void finalize() { diff --git a/java/org/rocksdb/Iterator.java b/java/org/rocksdb/RocksIterator.java similarity index 94% rename from java/org/rocksdb/Iterator.java rename to java/org/rocksdb/RocksIterator.java index 3c745a4d4..5b7d2c172 100644 --- a/java/org/rocksdb/Iterator.java +++ b/java/org/rocksdb/RocksIterator.java @@ -11,13 +11,13 @@ package org.rocksdb; * are provided by this library. In particular, iterators are provided * to access the contents of a Table or a DB. * - * Multiple threads can invoke const methods on an Iterator without + * Multiple threads can invoke const methods on an RocksIterator without * external synchronization, but if any of the threads may call a - * non-const method, all threads accessing the same Iterator must use + * non-const method, all threads accessing the same RocksIterator must use * external synchronization. */ -public class Iterator extends RocksObject { - public Iterator(long nativeHandle) { +public class RocksIterator extends RocksObject { + public RocksIterator(long nativeHandle) { super(); nativeHandle_ = nativeHandle; } diff --git a/java/org/rocksdb/benchmark/DbBenchmark.java b/java/org/rocksdb/benchmark/DbBenchmark.java index 5404b726a..f03e26090 100644 --- a/java/org/rocksdb/benchmark/DbBenchmark.java +++ b/java/org/rocksdb/benchmark/DbBenchmark.java @@ -416,7 +416,7 @@ public class DbBenchmark { super(tid, randSeed, numEntries, keyRange); } @Override public void runTask() throws RocksDBException { - org.rocksdb.Iterator iter = db_.newIterator(); + RocksIterator iter = db_.newIterator(); long i; for (iter.seekToFirst(), i = 0; iter.isValid() && i < numEntries_; diff --git a/java/rocksjni/iterator.cc b/java/rocksjni/iterator.cc index a7ea97d66..4c18a3491 100644 --- a/java/rocksjni/iterator.cc +++ b/java/rocksjni/iterator.cc @@ -10,66 +10,66 @@ #include #include -#include "include/org_rocksdb_Iterator.h" +#include "include/org_rocksdb_RocksIterator.h" #include "rocksjni/portal.h" #include "rocksdb/iterator.h" /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: isValid0 * Signature: (J)Z */ -jboolean Java_org_rocksdb_Iterator_isValid0( +jboolean Java_org_rocksdb_RocksIterator_isValid0( JNIEnv* env, jobject jobj, jlong handle) { return reinterpret_cast(handle)->Valid(); } /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: seekToFirst0 * Signature: (J)V */ -void Java_org_rocksdb_Iterator_seekToFirst0( +void Java_org_rocksdb_RocksIterator_seekToFirst0( JNIEnv* env, jobject jobj, jlong handle) { reinterpret_cast(handle)->SeekToFirst(); } /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: seekToFirst0 * Signature: (J)V */ -void Java_org_rocksdb_Iterator_seekToLast0( +void Java_org_rocksdb_RocksIterator_seekToLast0( JNIEnv* env, jobject jobj, jlong handle) { reinterpret_cast(handle)->SeekToLast(); } /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: seekToLast0 * Signature: (J)V */ -void Java_org_rocksdb_Iterator_next0( +void Java_org_rocksdb_RocksIterator_next0( JNIEnv* env, jobject jobj, jlong handle) { reinterpret_cast(handle)->Next(); } /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: next0 * Signature: (J)V */ -void Java_org_rocksdb_Iterator_prev0( +void Java_org_rocksdb_RocksIterator_prev0( JNIEnv* env, jobject jobj, jlong handle) { reinterpret_cast(handle)->Prev(); } /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: prev0 * Signature: (J)V */ -jbyteArray Java_org_rocksdb_Iterator_key0( +jbyteArray Java_org_rocksdb_RocksIterator_key0( JNIEnv* env, jobject jobj, jlong handle) { auto it = reinterpret_cast(handle); rocksdb::Slice key_slice = it->key(); @@ -82,11 +82,11 @@ jbyteArray Java_org_rocksdb_Iterator_key0( } /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: key0 * Signature: (J)[B */ -jbyteArray Java_org_rocksdb_Iterator_value0( +jbyteArray Java_org_rocksdb_RocksIterator_value0( JNIEnv* env, jobject jobj, jlong handle) { auto it = reinterpret_cast(handle); rocksdb::Slice value_slice = it->value(); @@ -99,11 +99,11 @@ jbyteArray Java_org_rocksdb_Iterator_value0( } /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: value0 * Signature: (J)[B */ -void Java_org_rocksdb_Iterator_seek0( +void Java_org_rocksdb_RocksIterator_seek0( JNIEnv* env, jobject jobj, jlong handle, jbyteArray jtarget, jint jtarget_len) { auto it = reinterpret_cast(handle); @@ -117,11 +117,11 @@ void Java_org_rocksdb_Iterator_seek0( } /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: seek0 * Signature: (J[BI)V */ -void Java_org_rocksdb_Iterator_status0( +void Java_org_rocksdb_RocksIterator_status0( JNIEnv* env, jobject jobj, jlong handle) { auto it = reinterpret_cast(handle); rocksdb::Status s = it->status(); @@ -134,11 +134,11 @@ void Java_org_rocksdb_Iterator_status0( } /* - * Class: org_rocksdb_Iterator + * Class: org_rocksdb_RocksIterator * Method: dispose * Signature: (J)V */ -void Java_org_rocksdb_Iterator_dispose( +void Java_org_rocksdb_RocksIterator_dispose( JNIEnv* env, jobject jobj, jlong handle) { auto it = reinterpret_cast(handle); delete it; diff --git a/java/rocksjni/portal.h b/java/rocksjni/portal.h index 7d70eecae..bd37bffcf 100644 --- a/java/rocksjni/portal.h +++ b/java/rocksjni/portal.h @@ -254,7 +254,7 @@ class IteratorJni { public: // Get the java class id of org.rocksdb.Iteartor. static jclass getJClass(JNIEnv* env) { - static jclass jclazz = env->FindClass("org/rocksdb/Iterator"); + static jclass jclazz = env->FindClass("org/rocksdb/RocksIterator"); assert(jclazz != nullptr); return jclazz; }