提交 34538706 编写于 作者: S Sagar Vemuri 提交者: Facebook Github Bot

Fix statistics in RocksJava sample

Summary:
I observed while doing a `make jtest` that the java sample was broken, due to the changes in #2551 .
Closes https://github.com/facebook/rocksdb/pull/2674

Differential Revision: D5539807

Pulled By: sagar0

fbshipit-source-id: 2c7e9d84778099dfa1c611996b444efe3c9fd466
上级 1900771b
......@@ -31,6 +31,7 @@ public class RocksDBSample {
final Filter bloomFilter = new BloomFilter(10);
final ReadOptions readOptions = new ReadOptions()
.setFillCache(false);
final Statistics stats = new Statistics();
final RateLimiter rateLimiter = new RateLimiter(10000000,10000, 10)) {
try (final RocksDB db = RocksDB.open(options, db_path_not_found)) {
......@@ -41,7 +42,7 @@ public class RocksDBSample {
try {
options.setCreateIfMissing(true)
.createStatistics()
.setStatistics(stats)
.setWriteBufferSize(8 * SizeUnit.KB)
.setMaxWriteBufferNumber(3)
.setMaxBackgroundCompactions(10)
......@@ -51,8 +52,6 @@ public class RocksDBSample {
assert (false);
}
final Statistics stats = options.statisticsPtr();
assert (options.createIfMissing() == true);
assert (options.writeBufferSize() == 8 * SizeUnit.KB);
assert (options.maxWriteBufferNumber() == 3);
......@@ -221,7 +220,9 @@ public class RocksDBSample {
try {
for (final TickerType statsType : TickerType.values()) {
stats.getTickerCount(statsType);
if (statsType != TickerType.TICKER_ENUM_MAX) {
stats.getTickerCount(statsType);
}
}
System.out.println("getTickerCount() passed.");
} catch (final Exception e) {
......@@ -231,7 +232,9 @@ public class RocksDBSample {
try {
for (final HistogramType histogramType : HistogramType.values()) {
HistogramData data = stats.getHistogramData(histogramType);
if (histogramType != HistogramType.HISTOGRAM_ENUM_MAX) {
HistogramData data = stats.getHistogramData(histogramType);
}
}
System.out.println("getHistogramData() passed.");
} catch (final Exception e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册