Add doc + refactor + fix formatting

This commit is contained in:
Ankit Gupta
2014-04-19 13:05:21 -07:00
parent 1d6c1e018f
commit dc28a726c1
7 changed files with 111 additions and 73 deletions

View File

@@ -141,9 +141,9 @@ public class RocksDBSample {
System.out.println("Failed in call to geHistogramData()");
assert(false); //Should never reach here.
}
Iterator iterator = db.iterator();
boolean seekToFirstPassed = false;
for (iterator.seekToFirst(); iterator.isValid(); iterator.next()) {
iterator.status();
@@ -154,7 +154,7 @@ public class RocksDBSample {
if(seekToFirstPassed) {
System.out.println("iterator seekToFirst tests passed.");
}
boolean seekToLastPassed = false;
for (iterator.seekToLast(); iterator.isValid(); iterator.prev()) {
iterator.status();
@@ -162,18 +162,18 @@ public class RocksDBSample {
assert(iterator.value() != null);
seekToLastPassed = true;
}
if(seekToLastPassed) {
System.out.println("iterator seekToLastPassed tests passed.");
}
iterator.seekToFirst();
iterator.seek(iterator.key());
assert(iterator.key() != null);
assert(iterator.value() != null);
System.out.println("iterator seek test passed.");
iterator.close();
System.out.println("iterator tests passed.");
} catch (RocksDBException e) {