diff --git a/java/src/main/java/org/rocksdb/MemoryUtil.java b/java/src/main/java/org/rocksdb/MemoryUtil.java index 331798259..4c5ad281c 100644 --- a/java/src/main/java/org/rocksdb/MemoryUtil.java +++ b/java/src/main/java/org/rocksdb/MemoryUtil.java @@ -33,7 +33,7 @@ public class MemoryUtil { final long[] dbHandles = new long[dbCount]; final long[] cacheHandles = new long[cacheCount]; for (int i = 0; i < dbCount; i++) { - dbHandles[i] = dbs.get(i).nativeHandle_; + dbHandles[i] = dbs.get(i).nativeHandle_; } Iterator itCache = null; for (int i = 0; i < cacheCount; i++) { diff --git a/java/src/test/java/org/rocksdb/MemoryUtilTest.java b/java/src/test/java/org/rocksdb/MemoryUtilTest.java index 1af33230f..6d78f65fb 100644 --- a/java/src/test/java/org/rocksdb/MemoryUtilTest.java +++ b/java/src/test/java/org/rocksdb/MemoryUtilTest.java @@ -45,7 +45,6 @@ public class MemoryUtilTest { new FlushOptions().setWaitForFlush(true); final RocksDB db = RocksDB.open(options, dbFolder1.getRoot().getAbsolutePath())) { - final List dbs = new ArrayList<>(1); dbs.add(db); final Set caches = new HashSet<>(1); @@ -123,13 +122,14 @@ public class MemoryUtilTest { caches.add(cache1); caches.add(cache2); - for (final RocksDB db: dbs) { + for (final RocksDB db : dbs) { db.put(key, value); db.flush(flushOptions); db.get(key); } - final Map usage = MemoryUtil.getApproximateMemoryUsageByType(dbs, caches); + final Map usage = + MemoryUtil.getApproximateMemoryUsageByType(dbs, caches); assertThat(usage.get(MemoryUsageType.kMemTableTotal)).isEqualTo( db1.getAggregatedLongProperty(MEMTABLE_SIZE) + db2.getAggregatedLongProperty(MEMTABLE_SIZE)); assertThat(usage.get(MemoryUsageType.kMemTableUnFlushed)).isEqualTo( diff --git a/java/src/test/java/org/rocksdb/util/TestUtil.java b/java/src/test/java/org/rocksdb/util/TestUtil.java index 6187a0aff..1dad0bf14 100644 --- a/java/src/test/java/org/rocksdb/util/TestUtil.java +++ b/java/src/test/java/org/rocksdb/util/TestUtil.java @@ -79,8 +79,8 @@ public class TestUtil { * * @return the random int */ - public static int intBetween(final Random random, final int minInclusive, - final int maxInclusive) { + public static int intBetween( + final Random random, final int minInclusive, final int maxInclusive) { return random.nextInt((maxInclusive - minInclusive) + 1) + minInclusive; } }