You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by db...@apache.org on 2015/01/24 03:06:49 UTC
[1/2] cassandra git commit: java8 bug? disambiquate
(ArrayUtils|StringUtils).isEmpty by not using static imports error: no
suitable method found for isEmpty(String)
Repository: cassandra
Updated Branches:
refs/heads/trunk feda54f04 -> 7b533d067
java8 bug? disambiquate (ArrayUtils|StringUtils).isEmpty by not using static imports
error: no suitable method found for isEmpty(String)
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1bb0c149
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1bb0c149
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1bb0c149
Branch: refs/heads/trunk
Commit: 1bb0c149eb9657be1dc4c488156ced617b622ceb
Parents: c468c8b
Author: Dave Brosius <db...@mebigfatguy.com>
Authored: Fri Jan 23 20:59:41 2015 -0500
Committer: Dave Brosius <db...@mebigfatguy.com>
Committed: Fri Jan 23 20:59:41 2015 -0500
----------------------------------------------------------------------
src/java/org/apache/cassandra/tools/NodeTool.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/1bb0c149/src/java/org/apache/cassandra/tools/NodeTool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java
index c2146c6..674b346 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -55,6 +55,7 @@ import org.apache.cassandra.streaming.StreamState;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.cassandra.utils.JVMStabilityInspector;
+import org.apache.commons.lang3.ArrayUtils;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Throwables.getStackTraceAsString;
@@ -63,7 +64,6 @@ import static com.google.common.collect.Lists.newArrayList;
import static java.lang.Integer.parseInt;
import static java.lang.String.format;
import static org.apache.commons.lang3.ArrayUtils.EMPTY_STRING_ARRAY;
-import static org.apache.commons.lang3.ArrayUtils.isEmpty;
import static org.apache.commons.lang3.StringUtils.*;
public class NodeTool
@@ -1019,7 +1019,7 @@ public class NodeTool
long[] estimatedRowSizeHistogram = store.getEstimatedRowSizeHistogram();
long[] estimatedColumnCountHistogram = store.getEstimatedColumnCountHistogram();
- if (isEmpty(estimatedRowSizeHistogram) || isEmpty(estimatedColumnCountHistogram))
+ if (ArrayUtils.isEmpty(estimatedRowSizeHistogram) || ArrayUtils.isEmpty(estimatedColumnCountHistogram))
{
System.err.println("No SSTables exists, unable to calculate 'Partition Size' and 'Cell Count' percentiles");
}
[2/2] cassandra git commit: Merge branch 'cassandra-2.1' into trunk
Posted by db...@apache.org.
Merge branch 'cassandra-2.1' into trunk
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/7b533d06
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7b533d06
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7b533d06
Branch: refs/heads/trunk
Commit: 7b533d0677fcbd93b45ae442e60ab9a302f57d3d
Parents: feda54f 1bb0c14
Author: Dave Brosius <db...@mebigfatguy.com>
Authored: Fri Jan 23 21:04:59 2015 -0500
Committer: Dave Brosius <db...@mebigfatguy.com>
Committed: Fri Jan 23 21:04:59 2015 -0500
----------------------------------------------------------------------
src/java/org/apache/cassandra/tools/NodeTool.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/7b533d06/src/java/org/apache/cassandra/tools/NodeTool.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tools/NodeTool.java
index b67dff9,674b346..18feac7
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@@ -1024,68 -1014,23 +1024,68 @@@ public class NodeToo
String keyspace = args.get(0);
String cfname = args.get(1);
- ColumnFamilyStoreMBean store = probe.getCfsProxy(keyspace, cfname);
+ // calculate percentile of row size and column count
+ long[] estimatedRowSize = (long[]) probe.getColumnFamilyMetric(keyspace, cfname, "EstimatedRowSizeHistogram");
+ long[] estimatedColumnCount = (long[]) probe.getColumnFamilyMetric(keyspace, cfname, "EstimatedColumnCountHistogram");
- long[] estimatedRowSizeHistogram = store.getEstimatedRowSizeHistogram();
- long[] estimatedColumnCountHistogram = store.getEstimatedColumnCountHistogram();
+ // build arrays to store percentile values
+ double[] estimatedRowSizePercentiles = new double[7];
+ double[] estimatedColumnCountPercentiles = new double[7];
+ double[] offsetPercentiles = new double[]{0.5, 0.75, 0.95, 0.98, 0.99};
- if (isEmpty(estimatedRowSize) || isEmpty(estimatedColumnCount))
- if (ArrayUtils.isEmpty(estimatedRowSizeHistogram) || ArrayUtils.isEmpty(estimatedColumnCountHistogram))
++ if (ArrayUtils.isEmpty(estimatedRowSize) || ArrayUtils.isEmpty(estimatedColumnCount))
{
System.err.println("No SSTables exists, unable to calculate 'Partition Size' and 'Cell Count' percentiles");
+
+ for (int i = 0; i < 7; i++)
+ {
+ estimatedRowSizePercentiles[i] = Double.NaN;
+ estimatedColumnCountPercentiles[i] = Double.NaN;
+ }
+ }
+ else
+ {
+ long[] rowSizeBucketOffsets = new EstimatedHistogram(estimatedRowSize.length).getBucketOffsets();
+ long[] columnCountBucketOffsets = new EstimatedHistogram(estimatedColumnCount.length).getBucketOffsets();
+ EstimatedHistogram rowSizeHist = new EstimatedHistogram(rowSizeBucketOffsets, estimatedRowSize);
+ EstimatedHistogram columnCountHist = new EstimatedHistogram(columnCountBucketOffsets, estimatedColumnCount);
+
+ if (rowSizeHist.isOverflowed())
+ {
+ System.err.println(String.format("Row sizes are larger than %s, unable to calculate percentiles", rowSizeBucketOffsets[rowSizeBucketOffsets.length - 1]));
+ for (int i = 0; i < offsetPercentiles.length; i++)
+ estimatedRowSizePercentiles[i] = Double.NaN;
+ }
+ else
+ {
+ for (int i = 0; i < offsetPercentiles.length; i++)
+ estimatedRowSizePercentiles[i] = rowSizeHist.percentile(offsetPercentiles[i]);
+ }
+
+ if (columnCountHist.isOverflowed())
+ {
+ System.err.println(String.format("Column counts are larger than %s, unable to calculate percentiles", columnCountBucketOffsets[columnCountBucketOffsets.length - 1]));
+ for (int i = 0; i < estimatedColumnCountPercentiles.length; i++)
+ estimatedColumnCountPercentiles[i] = Double.NaN;
+ }
+ else
+ {
+ for (int i = 0; i < offsetPercentiles.length; i++)
+ estimatedColumnCountPercentiles[i] = columnCountHist.percentile(offsetPercentiles[i]);
+ }
+
+ // min value
+ estimatedRowSizePercentiles[5] = rowSizeHist.min();
+ estimatedColumnCountPercentiles[5] = columnCountHist.min();
+ // max value
+ estimatedRowSizePercentiles[6] = rowSizeHist.max();
+ estimatedColumnCountPercentiles[6] = columnCountHist.max();
}
- // calculate percentile of row size and column count
String[] percentiles = new String[]{"50%", "75%", "95%", "98%", "99%", "Min", "Max"};
- double[] readLatency = probe.metricPercentilesAsArray(store.getRecentReadLatencyHistogramMicros());
- double[] writeLatency = probe.metricPercentilesAsArray(store.getRecentWriteLatencyHistogramMicros());
- double[] estimatedRowSizePercentiles = probe.metricPercentilesAsArray(estimatedRowSizeHistogram);
- double[] estimatedColumnCountPercentiles = probe.metricPercentilesAsArray(estimatedColumnCountHistogram);
- double[] sstablesPerRead = probe.metricPercentilesAsArray(store.getRecentSSTablesPerReadHistogram());
+ double[] readLatency = probe.metricPercentilesAsArray((JmxReporter.HistogramMBean) probe.getColumnFamilyMetric(keyspace, cfname, "ReadLatency"));
+ double[] writeLatency = probe.metricPercentilesAsArray((JmxReporter.TimerMBean) probe.getColumnFamilyMetric(keyspace, cfname, "WriteLatency"));
+ double[] sstablesPerRead = probe.metricPercentilesAsArray((JmxReporter.HistogramMBean) probe.getColumnFamilyMetric(keyspace, cfname, "SSTablesPerReadHistogram"));
System.out.println(format("%s/%s histograms", keyspace, cfname));
System.out.println(format("%-10s%10s%18s%18s%18s%18s",