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()");
assert(false); //Should never reach here.
}
try {
for (HistogramType histogramType : HistogramType.values()) {
HistogramData data = stats.geHistogramData(histogramType);

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

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

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

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

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

Loading…
Cancel
Save