From 17e84f2151a5de7ab57d6c6a3ad57a638c01727f Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Tue, 16 Dec 2014 14:32:42 +0000 Subject: [PATCH] Rudimentary test cases for setIncreaseParallelism --- java/org/rocksdb/test/DBOptionsTest.java | 14 ++++++++++++++ java/org/rocksdb/test/OptionsTest.java | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/java/org/rocksdb/test/DBOptionsTest.java b/java/org/rocksdb/test/DBOptionsTest.java index 6064dd694..858379768 100644 --- a/java/org/rocksdb/test/DBOptionsTest.java +++ b/java/org/rocksdb/test/DBOptionsTest.java @@ -73,6 +73,20 @@ public class DBOptionsTest { new Properties()); } + @Test + public void setIncreaseParallelism() { + DBOptions opt = null; + try { + opt = new DBOptions(); + final int threads = Runtime.getRuntime().availableProcessors() * 2; + opt.setIncreaseParallelism(threads); + } finally { + if (opt != null) { + opt.dispose(); + } + } + } + @Test public void createIfMissing() { DBOptions opt = null; diff --git a/java/org/rocksdb/test/OptionsTest.java b/java/org/rocksdb/test/OptionsTest.java index 3425502d8..0e699c406 100644 --- a/java/org/rocksdb/test/OptionsTest.java +++ b/java/org/rocksdb/test/OptionsTest.java @@ -22,6 +22,20 @@ public class OptionsTest { public static final Random rand = PlatformRandomHelper. getPlatformSpecificRandomFactory(); + @Test + public void setIncreaseParallelism() { + Options opt = null; + try { + opt = new Options(); + final int threads = Runtime.getRuntime().availableProcessors() * 2; + opt.setIncreaseParallelism(threads); + } finally { + if (opt != null) { + opt.dispose(); + } + } + } + @Test public void writeBufferSize() throws RocksDBException { Options opt = null;