Fix white spaces

main
Ankit Gupta 11 years ago
parent 6b0cc410e5
commit d3b44f072f
  1. 2
      java/RocksDBSample.java
  2. 16
      java/org/rocksdb/HistogramData.java
  3. 8
      java/org/rocksdb/HistogramType.java
  4. 12
      java/org/rocksdb/Statistics.java
  5. 6
      java/org/rocksdb/TickerType.java
  6. 6
      java/rocksjni/statistics.cc

@ -132,7 +132,7 @@ public class RocksDBSample {
System.out.println("Failed in call to getTickerCount()"); System.out.println("Failed in call to getTickerCount()");
assert(false); //Should never reach here. assert(false); //Should never reach here.
} }
try { try {
for (HistogramType histogramType : HistogramType.values()) { for (HistogramType histogramType : HistogramType.values()) {
HistogramData data = stats.geHistogramData(histogramType); HistogramData data = stats.geHistogramData(histogramType);

@ -11,8 +11,8 @@ public class HistogramData {
private final double percentile99_; private final double percentile99_;
private final double average_; private final double average_;
private final double standardDeviation_; private final double standardDeviation_;
public HistogramData(double median, double percentile95, public HistogramData(double median, double percentile95,
double percentile99, double average, double standardDeviation) { double percentile99, double average, double standardDeviation) {
median_ = median; median_ = median;
percentile95_ = percentile95; percentile95_ = percentile95;
@ -20,24 +20,24 @@ public class HistogramData {
average_ = average; average_ = average;
standardDeviation_ = standardDeviation; standardDeviation_ = standardDeviation;
} }
public double getMedian() { public double getMedian() {
return median_; return median_;
} }
public double getPercentile95() { public double getPercentile95() {
return percentile95_; return percentile95_;
} }
public double getPercentile99() { public double getPercentile99() {
return percentile99_; return percentile99_;
} }
public double getAverage() { public double getAverage() {
return average_; return average_;
} }
public double getStandardDeviation() { public double getStandardDeviation() {
return standardDeviation_; return standardDeviation_;
} }
} }

@ -26,14 +26,14 @@ public enum HistogramType {
HARD_RATE_LIMIT_DELAY_COUNT(15), HARD_RATE_LIMIT_DELAY_COUNT(15),
SOFT_RATE_LIMIT_DELAY_COUNT(16), SOFT_RATE_LIMIT_DELAY_COUNT(16),
NUM_FILES_IN_SINGLE_COMPACTION(17); NUM_FILES_IN_SINGLE_COMPACTION(17);
private final int value_; private final int value_;
private HistogramType(int value) { private HistogramType(int value) {
value_ = value; value_ = value;
} }
public int getValue() { public int getValue() {
return value_; return value_;
} }
} }

@ -10,28 +10,28 @@ package org.rocksdb;
* is managed by Options class. * is managed by Options class.
*/ */
public class Statistics { public class Statistics {
private final long statsHandle_; private final long statsHandle_;
public Statistics(long statsHandle) { public Statistics(long statsHandle) {
statsHandle_ = statsHandle; statsHandle_ = statsHandle;
} }
public long getTickerCount(TickerType tickerType) { public long getTickerCount(TickerType tickerType) {
assert(isInitialized()); assert(isInitialized());
return getTickerCount0(tickerType.getValue(), statsHandle_); return getTickerCount0(tickerType.getValue(), statsHandle_);
} }
public HistogramData geHistogramData(HistogramType histogramType) { public HistogramData geHistogramData(HistogramType histogramType) {
assert(isInitialized()); assert(isInitialized());
HistogramData hist = geHistogramData0(histogramType.getValue(), statsHandle_); HistogramData hist = geHistogramData0(histogramType.getValue(), statsHandle_);
return hist; return hist;
} }
private boolean isInitialized() { private boolean isInitialized() {
return (statsHandle_ != 0); return (statsHandle_ != 0);
} }
private native long getTickerCount0(int tickerType, long handle); private native long getTickerCount0(int tickerType, long handle);
private native HistogramData geHistogramData0(int histogramType, long handle); private native HistogramData geHistogramData0(int histogramType, long handle);
} }

@ -110,13 +110,13 @@ public enum TickerType {
NUMBER_SUPERVERSION_ACQUIRES(48), NUMBER_SUPERVERSION_ACQUIRES(48),
NUMBER_SUPERVERSION_RELEASES(49), NUMBER_SUPERVERSION_RELEASES(49),
NUMBER_SUPERVERSION_CLEANUPS(50); NUMBER_SUPERVERSION_CLEANUPS(50);
private final int value_; private final int value_;
private TickerType(int value) { private TickerType(int value) {
value_ = value; value_ = value;
} }
public int getValue() { public int getValue() {
return value_; return value_;
} }

@ -24,7 +24,7 @@ jlong Java_org_rocksdb_Statistics_getTickerCount0(
JNIEnv* env, jobject jobj, int tickerType, jlong handle) { JNIEnv* env, jobject jobj, int tickerType, jlong handle) {
auto st = reinterpret_cast<rocksdb::Statistics*>(handle); auto st = reinterpret_cast<rocksdb::Statistics*>(handle);
assert(st != nullptr); assert(st != nullptr);
return st->getTickerCount(static_cast<rocksdb::Tickers>(tickerType)); return st->getTickerCount(static_cast<rocksdb::Tickers>(tickerType));
} }
@ -32,11 +32,11 @@ jobject Java_org_rocksdb_Statistics_geHistogramData0(
JNIEnv* env, jobject jobj, int histogramType, jlong handle) { JNIEnv* env, jobject jobj, int histogramType, jlong handle) {
auto st = reinterpret_cast<rocksdb::Statistics*>(handle); auto st = reinterpret_cast<rocksdb::Statistics*>(handle);
assert(st != nullptr); assert(st != nullptr);
rocksdb::HistogramData data; rocksdb::HistogramData data;
st->histogramData(static_cast<rocksdb::Histograms>(histogramType), st->histogramData(static_cast<rocksdb::Histograms>(histogramType),
&data); &data);
// Don't reuse class pointer // Don't reuse class pointer
jclass jclazz = env->FindClass("org/rocksdb/HistogramData"); jclass jclazz = env->FindClass("org/rocksdb/HistogramData");
jmethodID mid = rocksdb::HistogramDataJni::getConstructorMethodId( jmethodID mid = rocksdb::HistogramDataJni::getConstructorMethodId(

Loading…
Cancel
Save