[jira] [Updated] (CASSANDRA-7131) Add command line option for cqlshrc file path

2014-09-14 Thread Aaron Ploetz (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aaron Ploetz updated CASSANDRA-7131:

Attachment: CASSANDRA-2.1.1-7131.txt

Added ability to source-in a specific cqlshrc file from the command line.



> Add command line option for cqlshrc file path
> -
>
> Key: CASSANDRA-7131
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7131
> Project: Cassandra
>  Issue Type: New Feature
>  Components: Tools
>Reporter: Jeremiah Jordan
>Priority: Trivial
>  Labels: lhf
> Attachments: CASSANDRA-2.1.1-7131.txt
>
>
> It would be nice if you could specify the cqlshrc file location on the 
> command line, so you don't have to jump through hoops when running it from a 
> service user or something.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


git commit: remove dead code

2014-09-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk 52d09eaa7 -> fb6c28514


remove dead code


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/fb6c2851
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/fb6c2851
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/fb6c2851

Branch: refs/heads/trunk
Commit: fb6c28514c5aabf56d64042652c1c079ec1642c8
Parents: 52d09ea
Author: Dave Brosius 
Authored: Sun Sep 14 22:29:49 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 22:29:49 2014 -0400

--
 src/java/org/apache/cassandra/service/StorageService.java | 3 ---
 1 file changed, 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb6c2851/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index 0e1ab2a..88c9a83 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -3631,9 +3631,6 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE

 TokenMetadata metadata = tokenMetadata.cloneOnlyTokenMap();
 
-if (keyspace == null)
-keyspace = Schema.instance.getNonSystemKeyspaces().get(0);
-
 Collection> endpointsGroupedByDc = new 
ArrayList<>();
 // mapping of dc's to nodes, use sorted map so that we get dcs sorted
 SortedMap> sortedDcsToEndpoints = new 
TreeMap<>();



git commit: make sure streams get closed

2014-09-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk c3d10abc7 -> 52d09eaa7


make sure streams get closed


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/52d09eaa
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/52d09eaa
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/52d09eaa

Branch: refs/heads/trunk
Commit: 52d09eaa7b7f6707902dd2db9816a24730af5f9f
Parents: c3d10ab
Author: Dave Brosius 
Authored: Sun Sep 14 22:25:01 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 22:25:01 2014 -0400

--
 .../org/apache/cassandra/utils/FBUtilities.java | 25 +++-
 1 file changed, 14 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/52d09eaa/src/java/org/apache/cassandra/utils/FBUtilities.java
--
diff --git a/src/java/org/apache/cassandra/utils/FBUtilities.java 
b/src/java/org/apache/cassandra/utils/FBUtilities.java
index 5e248bf..1634fa4 100644
--- a/src/java/org/apache/cassandra/utils/FBUtilities.java
+++ b/src/java/org/apache/cassandra/utils/FBUtilities.java
@@ -591,17 +591,20 @@ public class FBUtilities
 int errCode = p.waitFor();
 if (errCode != 0)
 {
-BufferedReader in = new BufferedReader(new 
InputStreamReader(p.getInputStream()));
-BufferedReader err = new BufferedReader(new 
InputStreamReader(p.getErrorStream()));
-StringBuilder sb = new StringBuilder();
-String str;
-while ((str = in.readLine()) != null)
-
sb.append(str).append(System.getProperty("line.separator"));
-while ((str = err.readLine()) != null)
-
sb.append(str).append(System.getProperty("line.separator"));
-throw new IOException("Exception while executing the command: 
"+ StringUtils.join(pb.command(), " ") +
-  ", command error Code: " + errCode +
-  ", command output: "+ sb.toString());
+   try (BufferedReader in = new BufferedReader(new 
InputStreamReader(p.getInputStream()));
+ BufferedReader err = new BufferedReader(new 
InputStreamReader(p.getErrorStream(
+{
+   String lineSep = System.getProperty("line.separator");
+   StringBuilder sb = new StringBuilder();
+   String str;
+   while ((str = in.readLine()) != null)
+   sb.append(str).append(lineSep);
+   while ((str = err.readLine()) != null)
+   sb.append(str).append(lineSep);
+   throw new IOException("Exception while executing the 
command: "+ StringUtils.join(pb.command(), " ") +
+ ", command error Code: " + 
errCode +
+ ", command output: "+ 
sb.toString());
+}
 }
 }
 catch (InterruptedException e)



[1/2] git commit: don't call getCompactions thru the proxy twice for compactionstats

2014-09-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk 0494cf75c -> c3d10abc7


don't call getCompactions thru the proxy twice for compactionstats


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/db3cc3e6
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/db3cc3e6
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/db3cc3e6

Branch: refs/heads/trunk
Commit: db3cc3e65163dbb6ef0f75a158f632d168e314d9
Parents: 2c28fde
Author: Dave Brosius 
Authored: Sun Sep 14 22:01:27 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 22:01:27 2014 -0400

--
 src/java/org/apache/cassandra/tools/NodeTool.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/db3cc3e6/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 08a8055..fbdce0f 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -1175,13 +1175,14 @@ public class NodeTool
 CompactionManagerMBean cm = probe.getCompactionManagerProxy();
 System.out.println("pending tasks: " + 
probe.getCompactionMetric("PendingTasks"));
 long remainingBytes = 0;
-if (cm.getCompactions().size() > 0)
+List> compactions = cm.getCompactions();
+if (!compactions.isEmpty())
 {
 List lines = new ArrayList<>();
 int[] columnSizes = new int[] { 0, 0, 0, 0, 0, 0, 0 };
 
 addLine(lines, columnSizes, "compaction type", "keyspace", 
"table", "completed", "total", "unit", "progress");
-for (Map c : cm.getCompactions())
+for (Map c : compactions)
 {
 long total = Long.parseLong(c.get("total"));
 long completed = Long.parseLong(c.get("completed"));



git commit: don't call getCompactions thru the proxy twice for compactionstats

2014-09-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 2c28fded1 -> db3cc3e65


don't call getCompactions thru the proxy twice for compactionstats


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/db3cc3e6
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/db3cc3e6
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/db3cc3e6

Branch: refs/heads/cassandra-2.1
Commit: db3cc3e65163dbb6ef0f75a158f632d168e314d9
Parents: 2c28fde
Author: Dave Brosius 
Authored: Sun Sep 14 22:01:27 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 22:01:27 2014 -0400

--
 src/java/org/apache/cassandra/tools/NodeTool.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/db3cc3e6/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 08a8055..fbdce0f 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -1175,13 +1175,14 @@ public class NodeTool
 CompactionManagerMBean cm = probe.getCompactionManagerProxy();
 System.out.println("pending tasks: " + 
probe.getCompactionMetric("PendingTasks"));
 long remainingBytes = 0;
-if (cm.getCompactions().size() > 0)
+List> compactions = cm.getCompactions();
+if (!compactions.isEmpty())
 {
 List lines = new ArrayList<>();
 int[] columnSizes = new int[] { 0, 0, 0, 0, 0, 0, 0 };
 
 addLine(lines, columnSizes, "compaction type", "keyspace", 
"table", "completed", "total", "unit", "progress");
-for (Map c : cm.getCompactions())
+for (Map c : compactions)
 {
 long total = Long.parseLong(c.get("total"));
 long completed = Long.parseLong(c.get("completed"));



[2/2] git commit: Merge branch 'cassandra-2.1' into trunk

2014-09-14 Thread dbrosius
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/c3d10abc
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c3d10abc
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c3d10abc

Branch: refs/heads/trunk
Commit: c3d10abc7dc2c4bb9db358c3d510de29d5ae51ca
Parents: 0494cf7 db3cc3e
Author: Dave Brosius 
Authored: Sun Sep 14 22:01:53 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 22:01:53 2014 -0400

--
 src/java/org/apache/cassandra/tools/NodeTool.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c3d10abc/src/java/org/apache/cassandra/tools/NodeTool.java
--



[1/2] git commit: format doubles with %f

2014-09-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk 284480f04 -> 0494cf75c


format doubles with %f


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2c28fded
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2c28fded
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2c28fded

Branch: refs/heads/trunk
Commit: 2c28fded11d70f5880db4077b0d9702df0c7fcf3
Parents: cbc36e0
Author: Dave Brosius 
Authored: Sun Sep 14 20:47:45 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 20:47:45 2014 -0400

--
 src/java/org/apache/cassandra/tools/NodeTool.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c28fded/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 7a8e04d..08a8055 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -2372,7 +2372,7 @@ public class NodeTool
 double mean = stats[2] / stats[5];
 double stdev = Math.sqrt((stats[3] / stats[5]) - (mean * mean));
 System.out.printf("%20s%20s%20s%20s%20s%20s%n", "Interval (ms)", 
"Max GC Elapsed (ms)", "Total GC Elapsed (ms)", "Stdev GC Elapsed (ms)", "GC 
Reclaimed (MB)", "Collections");
-System.out.printf("%20.0d%20.0d%20.0d%20.0d%20.0d%n", stats[0], 
stats[1], stats[2], stdev, stats[4], stats[5]);
+System.out.printf("%20.0f%20.0f%20.0f%20.0f%20.0f%n", stats[0], 
stats[1], stats[2], stdev, stats[4], stats[5]);
 }
 }
 



[2/2] git commit: Merge branch 'cassandra-2.1' into trunk

2014-09-14 Thread dbrosius
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/0494cf75
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0494cf75
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0494cf75

Branch: refs/heads/trunk
Commit: 0494cf75c3eae0be7d0337674cb65d226575cf50
Parents: 284480f 2c28fde
Author: Dave Brosius 
Authored: Sun Sep 14 20:48:12 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 20:48:12 2014 -0400

--
 src/java/org/apache/cassandra/tools/NodeTool.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0494cf75/src/java/org/apache/cassandra/tools/NodeTool.java
--



git commit: format doubles with %f

2014-09-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 cbc36e019 -> 2c28fded1


format doubles with %f


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2c28fded
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2c28fded
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2c28fded

Branch: refs/heads/cassandra-2.1
Commit: 2c28fded11d70f5880db4077b0d9702df0c7fcf3
Parents: cbc36e0
Author: Dave Brosius 
Authored: Sun Sep 14 20:47:45 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 20:47:45 2014 -0400

--
 src/java/org/apache/cassandra/tools/NodeTool.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c28fded/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 7a8e04d..08a8055 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -2372,7 +2372,7 @@ public class NodeTool
 double mean = stats[2] / stats[5];
 double stdev = Math.sqrt((stats[3] / stats[5]) - (mean * mean));
 System.out.printf("%20s%20s%20s%20s%20s%20s%n", "Interval (ms)", 
"Max GC Elapsed (ms)", "Total GC Elapsed (ms)", "Stdev GC Elapsed (ms)", "GC 
Reclaimed (MB)", "Collections");
-System.out.printf("%20.0d%20.0d%20.0d%20.0d%20.0d%n", stats[0], 
stats[1], stats[2], stdev, stats[4], stats[5]);
+System.out.printf("%20.0f%20.0f%20.0f%20.0f%20.0f%n", stats[0], 
stats[1], stats[2], stdev, stats[4], stats[5]);
 }
 }
 



[2/2] git commit: Merge branch 'cassandra-2.1' into trunk

2014-09-14 Thread dbrosius
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/284480f0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/284480f0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/284480f0

Branch: refs/heads/trunk
Commit: 284480f044cb7f7434de6abbd5fe605fd79920e9
Parents: e4e6e90 cbc36e0
Author: Dave Brosius 
Authored: Sun Sep 14 20:43:26 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 20:43:26 2014 -0400

--
 src/java/org/apache/cassandra/tools/NodeTool.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/284480f0/src/java/org/apache/cassandra/tools/NodeTool.java
--



git commit: fix format string to match the number of input values

2014-09-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 a6678a273 -> cbc36e019


fix format string to match the number of input values


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cbc36e01
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cbc36e01
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cbc36e01

Branch: refs/heads/cassandra-2.1
Commit: cbc36e019b589ea7a08433853160a582fc579c93
Parents: a6678a2
Author: Dave Brosius 
Authored: Sun Sep 14 20:43:07 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 20:43:07 2014 -0400

--
 src/java/org/apache/cassandra/tools/NodeTool.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cbc36e01/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 731afcc..7a8e04d 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -2371,7 +2371,7 @@ public class NodeTool
 double[] stats = probe.getAndResetGCStats();
 double mean = stats[2] / stats[5];
 double stdev = Math.sqrt((stats[3] / stats[5]) - (mean * mean));
-System.out.printf("%20s%20s%20s%20s%20s%n", "Interval (ms)", "Max 
GC Elapsed (ms)", "Total GC Elapsed (ms)", "Stdev GC Elapsed (ms)", "GC 
Reclaimed (MB)", "Collections");
+System.out.printf("%20s%20s%20s%20s%20s%20s%n", "Interval (ms)", 
"Max GC Elapsed (ms)", "Total GC Elapsed (ms)", "Stdev GC Elapsed (ms)", "GC 
Reclaimed (MB)", "Collections");
 System.out.printf("%20.0d%20.0d%20.0d%20.0d%20.0d%n", stats[0], 
stats[1], stats[2], stdev, stats[4], stats[5]);
 }
 }



[1/2] git commit: fix format string to match the number of input values

2014-09-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk e4e6e907c -> 284480f04


fix format string to match the number of input values


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cbc36e01
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cbc36e01
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cbc36e01

Branch: refs/heads/trunk
Commit: cbc36e019b589ea7a08433853160a582fc579c93
Parents: a6678a2
Author: Dave Brosius 
Authored: Sun Sep 14 20:43:07 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 20:43:07 2014 -0400

--
 src/java/org/apache/cassandra/tools/NodeTool.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cbc36e01/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 731afcc..7a8e04d 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -2371,7 +2371,7 @@ public class NodeTool
 double[] stats = probe.getAndResetGCStats();
 double mean = stats[2] / stats[5];
 double stdev = Math.sqrt((stats[3] / stats[5]) - (mean * mean));
-System.out.printf("%20s%20s%20s%20s%20s%n", "Interval (ms)", "Max 
GC Elapsed (ms)", "Total GC Elapsed (ms)", "Stdev GC Elapsed (ms)", "GC 
Reclaimed (MB)", "Collections");
+System.out.printf("%20s%20s%20s%20s%20s%20s%n", "Interval (ms)", 
"Max GC Elapsed (ms)", "Total GC Elapsed (ms)", "Stdev GC Elapsed (ms)", "GC 
Reclaimed (MB)", "Collections");
 System.out.printf("%20.0d%20.0d%20.0d%20.0d%20.0d%n", stats[0], 
stats[1], stats[2], stdev, stats[4], stats[5]);
 }
 }



git commit: remove orphanable field 'connectionFactory'

2014-09-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk 58985409c -> e4e6e907c


remove orphanable field 'connectionFactory'


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e4e6e907
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e4e6e907
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e4e6e907

Branch: refs/heads/trunk
Commit: e4e6e907c856f17d927e19e2ff22c99f9f3bf7d9
Parents: 5898540
Author: Dave Brosius 
Authored: Sun Sep 14 20:35:43 2014 -0400
Committer: Dave Brosius 
Committed: Sun Sep 14 20:35:43 2014 -0400

--
 src/java/org/apache/cassandra/streaming/StreamPlan.java | 4 +---
 src/java/org/apache/cassandra/utils/Hex.java| 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4e6e907/src/java/org/apache/cassandra/streaming/StreamPlan.java
--
diff --git a/src/java/org/apache/cassandra/streaming/StreamPlan.java 
b/src/java/org/apache/cassandra/streaming/StreamPlan.java
index f7b6203..ca448a3 100644
--- a/src/java/org/apache/cassandra/streaming/StreamPlan.java
+++ b/src/java/org/apache/cassandra/streaming/StreamPlan.java
@@ -38,8 +38,6 @@ public class StreamPlan
 private final long repairedAt;
 private final StreamCoordinator coordinator;
 
-private StreamConnectionFactory connectionFactory = new 
DefaultConnectionFactory();
-
 private boolean flushBeforeTransfer = true;
 
 /**
@@ -56,7 +54,7 @@ public class StreamPlan
 {
 this.description = description;
 this.repairedAt = repairedAt;
-this.coordinator = new StreamCoordinator(connectionsPerHost, 
connectionFactory);
+this.coordinator = new StreamCoordinator(connectionsPerHost, new 
DefaultConnectionFactory());
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4e6e907/src/java/org/apache/cassandra/utils/Hex.java
--
diff --git a/src/java/org/apache/cassandra/utils/Hex.java 
b/src/java/org/apache/cassandra/utils/Hex.java
index 5ba0b1a..13daa43 100644
--- a/src/java/org/apache/cassandra/utils/Hex.java
+++ b/src/java/org/apache/cassandra/utils/Hex.java
@@ -118,9 +118,9 @@ public class Hex
  * @return Constructor if successful, null if the constructor cannot be
  * accessed
  */
-public static Constructor getProtectedConstructor(Class klass, Class... 
paramTypes)
+public static  Constructor getProtectedConstructor(Class klass, 
Class... paramTypes)
 {
-Constructor c;
+Constructor c;
 try
 {
 c = klass.getDeclaredConstructor(paramTypes);



[jira] [Commented] (CASSANDRA-7838) Warn user when disks are network/ebs mounted

2014-09-14 Thread AMIT KUMAR (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133409#comment-14133409
 ] 

AMIT KUMAR commented on CASSANDRA-7838:
---

I looked up sigar code:
https://github.com/hyperic/sigar/blob/189843858ecd8da7fb94a6b274269877c2416b3a/src/sigar.c#L520
You are right -it checks the file system type to determine if the file system 
is networked or not, so it will not find SAN or EBS, the log info is of limited 
value, but it will emit a warning about NFS/SMB etc. -that does seem to provide 
some value but not address this ticket's intention.

We had talked about other things that could be done with SIGAR -like getting 
the load information and emitting a warning when the system load is high, 
keeping some history about read and write queues of the disk and warn when 
things are going south.

I would be happy to do some more digging and see where we can go with this.






> Warn user when disks are network/ebs mounted
> 
>
> Key: CASSANDRA-7838
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7838
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: T Jake Luciani
>Priority: Minor
>  Labels: lhf
> Fix For: 3.0
>
>
> The Sigar project let's you probe os/cpu/filesystems across the major 
> platforms.
> https://github.com/hyperic/sigar
> It would be nice on start-up to use this to warn users if they are running 
> with settings that will make them sad, like Network drive or EBS on Ec2.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-3017) add a Message size limit

2014-09-14 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133403#comment-14133403
 ] 

Jonathan Ellis commented on CASSANDRA-3017:
---

bq. in all this time I've never heard of it actually being a problem

OTOH it's one of those things that just looks amateurish if someone decides to 
check and see what happens...

The good news is that since we wrote our own protocol for CQL, it should be 
straightforward to make sure we're measuring the same thing there as for 
MessagingService.

> add a Message size limit
> 
>
> Key: CASSANDRA-3017
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3017
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Jonathan Ellis
>Priority: Minor
>  Labels: lhf
> Attachments: 
> 0001-use-the-thrift-max-message-size-for-inter-node-messa.patch, 
> trunk-3017.txt
>
>
> We protect the server from allocating huge buffers for malformed message with 
> the Thrift frame size (CASSANDRA-475).  But we don't have similar protection 
> for the inter-node Message objects.
> Adding this would be good to deal with malicious adversaries as well as a 
> malfunctioning cluster participant.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7820) Remove fat client mode

2014-09-14 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133404#comment-14133404
 ] 

Brandon Williams commented on CASSANDRA-7820:
-

The simplest example is bootstrapping nodes that haven't completed or fail.

> Remove fat client mode
> --
>
> Key: CASSANDRA-7820
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7820
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Jonathan Ellis
>Assignee: Brandon Williams
> Fix For: 3.0
>
> Attachments: 7820-v1.txt, 7820-v2.txt, 7820-v3.txt
>
>
> Now that we support push notifications server -> client, there's no reason to 
> have clients participating in gossip directly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7820) Remove fat client mode

2014-09-14 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133398#comment-14133398
 ] 

Jonathan Ellis commented on CASSANDRA-7820:
---

What gossip only members will we have left?

> Remove fat client mode
> --
>
> Key: CASSANDRA-7820
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7820
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Jonathan Ellis
>Assignee: Brandon Williams
> Fix For: 3.0
>
> Attachments: 7820-v1.txt, 7820-v2.txt, 7820-v3.txt
>
>
> Now that we support push notifications server -> client, there's no reason to 
> have clients participating in gossip directly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-4914) Aggregation functions in CQL

2014-09-14 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133395#comment-14133395
 ] 

Benjamin Lerer commented on CASSANDRA-4914:
---

bq. Nice work, Benjamin Lerer :-)

Thanks Robert.
 
bq.  Regarding COUNT(*)/COUNT(1) - can you change/extend that to also allow 
COUNT(any_column) or even COUNT(func_call)? The v3 patch does not handle this.

It is already there. See last line of AggregationTest.testFunctions()

bq.Can you add a test to check whether an aggregate works against a UDF and 
vice versa? E.g. some "sin" function: SELECT sin(max(a)) FROM foo or SELECT 
max(sin(a)) FROM foo

The first form is already there. See AggregationTest.testNestedFunctions(). I 
will add the second form.

bq. The aggregate functions do only return their input type. Means: overflows 
are not handled. It's not a problem for the BigDecimal/BigInteger 
implementations but for all the others. Maybe it's better to do all sum+avg on 
the BigDecimal/BigInteger types and always return them - although it's slower, 
the result will be correct. As a nice side effect it could be possible to 
reduce the number of avg/sum implementations and let them extend some few impls.

See first feed back from Sylvain

bq.The implementations of the aggregate functions are sometimes declared 
using public static final and sometimes using public static - nice to have: 
make them look equal

I will fix it.


> Aggregation functions in CQL
> 
>
> Key: CASSANDRA-4914
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4914
> Project: Cassandra
>  Issue Type: New Feature
>Reporter: Vijay
>Assignee: Benjamin Lerer
>  Labels: cql, docs
> Fix For: 3.0
>
> Attachments: CASSANDRA-4914-V2.txt, CASSANDRA-4914-V3.txt, 
> CASSANDRA-4914.txt
>
>
> The requirement is to do aggregation of data in Cassandra (Wide row of column 
> values of int, double, float etc).
> With some basic agree gate functions like AVG, SUM, Mean, Min, Max, etc (for 
> the columns within a row).
> Example:
> SELECT * FROM emp WHERE empID IN (130) ORDER BY deptID DESC;  
>   
>  empid | deptid | first_name | last_name | salary
> ---+++---+
>130 |  3 | joe| doe   |   10.1
>130 |  2 | joe| doe   |100
>130 |  1 | joe| doe   |  1e+03
>  
> SELECT sum(salary), empid FROM emp WHERE empID IN (130);  
>   
>  sum(salary) | empid
> -+
>1110.1|  130



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7838) Warn user when disks are network/ebs mounted

2014-09-14 Thread Carl Yeksigian (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133375#comment-14133375
 ] 

Carl Yeksigian commented on CASSANDRA-7838:
---

It looks like the SIGAR library isn't rich enough to provide whether or not the 
storage is some SAN or EBS. SIGAR only provides the storage type based on how 
the disk is formatted; an EBS or SAN volume will be formatted as a normal drive 
would be, so we will incorrectly label it as LOCAL_DISK. It will only catch 
cases such as an NFS or CIFS mount.

If we can find a different use for SIGAR, most of the setup work is done; I 
don't think we should include this for the network check, though.

> Warn user when disks are network/ebs mounted
> 
>
> Key: CASSANDRA-7838
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7838
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: T Jake Luciani
>Priority: Minor
>  Labels: lhf
> Fix For: 3.0
>
>
> The Sigar project let's you probe os/cpu/filesystems across the major 
> platforms.
> https://github.com/hyperic/sigar
> It would be nice on start-up to use this to warn users if they are running 
> with settings that will make them sad, like Network drive or EBS on Ec2.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7523) add date and time types

2014-09-14 Thread Joshua McKenzie (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133371#comment-14133371
 ] 

Joshua McKenzie commented on CASSANDRA-7523:


V1 of the changes is ready for review.

[Cassandra 
changes|https://github.com/josh-mckenzie/cassandra/compare/7523_squashed]
[Python driver 
changes|https://github.com/josh-mckenzie/python-driver/compare/7523_squashed]

{quote}
Do we really want to add this in 2.0? This is fairly isolated, but it would be 
nice to not introduce new bugs this late in 2.0.
{quote}
Rebased to 2.1.  I agree.

{quote}
Should we be storing dates as four bytes and a days-since-epoch format like 
postgres? This would be more compact and allow for a wider range of supported 
dates.
{quote}
Rewrote based on Integertype, days since epoch.  I used joda for date parsing 
and formatting - the built-in java date libraries have a variety of problems 
that didn't make them suitable candidates for this work (thread-safety, 
non-proleptic by default, etc)

{quote}
I feel pretty strongly that the time type should support microsecond 
resolution, even if we can't provide microsecond resolution with 
functions/special values like now until Java 8.
{quote}
I went with nanoseconds since midnight.  It adds the complexity of 
serialization to and from string but should add little as far as data footprint 
on disk with compression enabled and this prevents us from having to rework a 
higher resolution type down the line (see CASSANDRA-7536)

{quote}
I wouldn't accept a millis-since-epoch string for dateStringToDate()
{quote}
Done

{quote}
TimeType should not be compatible with DateType and TimestampType (nor should 
SimpleDateType if we use a four-byte format)
{quote}
Done

{quote}
I would use "date" instead of "simpledate" in a few places: CQL3Types.Native, 
Cql3.g (K_SIMPLEDATE), Constants.Type
{quote}
Done.  I also updated the CQL html help docs to reflect a more consistent 
naming scheme (timestamp, date, time)

{quote}
Definitely needs a lot of tests before committing (to whichever branch).
{quote}
Tests for types, serialization, cqlshlib, types in python driver, and 
integration tests on driver added.  Let me know if you can think of anything 
else that could use some testing in this context.

{quote}
We do want to leave the format the same for timestamps. I would add a new 
format option for the "time" type and leave the existing one for timestamps.
{quote}
Done.

Once we get the java side ironed out I'll get the ball rolling on python driver 
change review/integration and open another ticket to update the bundled driver 
to support these new types.

> add date and time types
> ---
>
> Key: CASSANDRA-7523
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7523
> Project: Cassandra
>  Issue Type: New Feature
>  Components: API
>Reporter: Jonathan Ellis
>Assignee: Joshua McKenzie
>Priority: Minor
> Fix For: 2.1.1, 3.0
>
>
> http://www.postgresql.org/docs/9.1/static/datatype-datetime.html
> (we already have timestamp; interval is out of scope for now, and see 
> CASSANDRA-6350 for discussion on timestamp-with-time-zone.  but date/time 
> should be pretty easy to add.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7020) Incorrect result of query WHERE token(key) < -9223372036854775808 when using Murmur3Partitioner

2014-09-14 Thread Marko Denda (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133370#comment-14133370
 ] 

Marko Denda commented on CASSANDRA-7020:


Hi,

I don't see reason why is this classified as error. 

During execution of execute_cql3_query   select * from test where token("key") 
< -9223372036854775808 with tracing on we see following output:

 key | value
-+-
   5  | kkk
  50 |  rr
  10 | bbb
  25 |   c

(4 rows)


Tracing session: 5e9ad790-3c4a-11e4-bc20-d7d1fe420dc4

 activity   
 | timestamp| source| source_elapsed
-+--+---+
  
execute_cql3_query | 22:04:44,042 | 127.0.0.1 |  0
   Parsing select * from test where token("key") < 
-9223372036854775808; | 22:04:44,042 | 127.0.0.1 |121
 
Preparing statement | 22:04:44,043 | 127.0.0.1 |605
   Determining 
replicas to query | 22:04:44,043 | 127.0.0.1 |966
 Executing seq scan across 1 sstables for (min(-9223372036854775808), 
min(-9223372036854775808)] | 22:04:44,057 | 127.0.0.1 |  15008
  Read 1 live and 0 
tombstoned cells | 22:04:44,059 | 127.0.0.1 |  16339
  Read 1 live and 0 
tombstoned cells | 22:04:44,059 | 127.0.0.1 |  16583
  Read 1 live and 0 
tombstoned cells | 22:04:44,059 | 127.0.0.1 |  16816
  Read 1 live and 0 
tombstoned cells | 22:04:44,059 | 127.0.0.1 |  17009
Scanned 4 
rows and matched 4 | 22:04:44,059 | 127.0.0.1 |  17202

Request complete | 22:04:44,059 | 127.0.0.1 |  17798

which is the same as select * from test;
cqlsh:sample> select * from test;

 key | value
-+-
   5  | kkk
  50 |  rr
  10 | bbb
  25 |   c

(4 rows)


Tracing session: 16f5c710-3c4a-11e4-bc20-d7d1fe420dc4

 activity   
 | timestamp| source| source_elapsed
-+--+---+
  
execute_cql3_query | 22:02:43,842 | 127.0.0.1 |  0
 Parsing select * from 
test LIMIT 1; | 22:02:43,842 | 127.0.0.1 |115
 
Preparing statement | 22:02:43,843 | 127.0.0.1 |468
   Determining 
replicas to query | 22:02:43,843 | 127.0.0.1 |843
 Executing seq scan across 1 sstables for [min(-9223372036854775808), 
min(-9223372036854775808)] | 22:02:43,861 | 127.0.0.1 |  19150
 Seeking to partition 
beginning in data file | 22:02:43,862 | 127.0.0.1 |  19957
  Read 1 live and 0 
tombstoned cells | 22:02:43,863 | 127.0.0.1 |  20425
 Seeking to partition 
beginning in data file | 22:02:43,863 | 127.0.0.1 |  20574
  Read 1 live and 0 
tombstoned cells | 22:02:43,863 | 127.0.0.1 |  20741
 Seeking to partition 
beginning in data file | 22:02:43,863 | 127.0.0.1 |  20869
  Read 1 live and 0 
tombstoned cells | 22:02:43,863 | 127.0.0.1 |  21033
 Seeking to partition 
beginning in data file | 22:02:43,863 | 127.0.0.1 |  21126
  Read 1 live and 0 
tombstoned cells | 22:02:43,864 | 127.0.0.1 |  21287
Scanned 4 
rows and matched 4 | 22:02:43,864 | 127.0.0.1 |  21489

[jira] [Commented] (CASSANDRA-7925) TimeUUID LSB should be unique per process, not just per machine

2014-09-14 Thread JIRA

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133357#comment-14133357
 ] 

Peter Mädel commented on CASSANDRA-7925:


At least for the java driver it is mandatory to add some reference to the 
classloader, as static variables always belong to the classloader. lsb 
collisions would occur e.g. when several clients are deployed within separate 
webapps but the same tomcat. each client would have the identical pid, but 
different classloaders.

I dont know enough about the server runtime to decide if this is an issue for 
C* though.

> TimeUUID LSB should be unique per process, not just per machine
> ---
>
> Key: CASSANDRA-7925
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7925
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Peter Mädel
> Attachments: cassandra-uuidgen.patch
>
>
> as pointed out in 
> [CASSANDRA-7919|https://issues.apache.org/jira/browse/CASSANDRA-7919?focusedCommentId=14132529&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14132529]
>  lsb collisions are also possible serverside.
> a sufficient solution would be to include references to pid and classloader 
> within lsb.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (CASSANDRA-7936) Cassandra is not getting compiled on Java 1.8

2014-09-14 Thread Brandon Williams (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brandon Williams resolved CASSANDRA-7936.
-
Resolution: Duplicate

> Cassandra is not getting compiled on Java 1.8
> -
>
> Key: CASSANDRA-7936
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7936
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: $ java -version
> java version "1.8.0"
> Java(TM) SE Runtime Environment (build 1.8.0-b132)
> Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
> $ ant -version
> Apache Ant(TM) version 1.9.4 compiled on April 29 2014
>Reporter: Ramesh Mandaleeka
> Fix For: 2.1.0
>
>
> I'm trying to install a new cluster based on the following command and 
> getting an error:
> ccm create cluster1 --cassandra-version 2.1.0
> Not sure if the issue is with ccm or cassandra.
> gen-cql3-grammar:
> [echo] Building Grammar 
> /Users/ramesh/.ccm/repository/2.1.0/src/java/org/apache/cassandra/cql3/Cql.g 
> ...
> [java] error(10): internal error: Can't get property indirectDelegates using 
> method get/isIndirectDelegates from org.antlr.tool.Grammar instance : 
> java.lang.NullPointerException
> [java] java.util.Objects.requireNonNull(Objects.java:203)
> [java] java.util.ArrayList.removeAll(ArrayList.java:674)
> [java] 
> org.antlr.tool.CompositeGrammar.getIndirectDelegates(CompositeGrammar.java:222)
> [java] org.antlr.tool.Grammar.getIndirectDelegates(Grammar.java:2620)
> [java] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [java] 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> [java] 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> [java] java.lang.reflect.Method.invoke(Method.java:483)
> [java] 
> org.antlr.stringtemplate.language.ASTExpr.invokeMethod(ASTExpr.java:564)
> [java] 
> org.antlr.stringtemplate.language.ASTExpr.rawGetObjectProperty(ASTExpr.java:515)
> [java] 
> org.antlr.stringtemplate.language.ASTExpr.getObjectProperty(ASTExpr.java:417)
> [java] 
> org.antlr.stringtemplate.language.ActionEvaluator.attribute(ActionEvaluator.java:351)
> [java] 
> org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:136)
> [java] 
> org.antlr.stringtemplate.language.ActionEvaluator.templateApplication(ActionEvaluator.java:216)
> [java] 
> org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:126)
> [java] 
> org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:84)
> [java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
> [java] org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
> [java] 
> org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
> [java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
> [java] 
> org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
> [java] 
> org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
> [java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
> [java] org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
> [java] 
> org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
> [java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
> [java] 
> org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
> [java] 
> org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
> [java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
> [java] org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
> [java] 
> org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
> [java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
> [java] 
> org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
> [java] 
> org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
> [java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
> [java] org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
> [java] org.antlr.codegen.CodeGenerator.write(CodeGenerator.java:1281)
> [java] org.antlr.codegen.Target.genRecognizerFile(Target.java:94)
> [java] org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:466)
> [java] org.antlr.Tool.generateRecognizer(Tool.java:641)
> [java] org.antlr.Tool.process(Tool.java:454)
> [java] org.antlr.Tool.main(Tool.java:91)
> BUILD FAILED
> /Users/ramesh/.ccm/repository/2.1.0/build.xml:239: Java returned: 1
> Error:
> ccm create cluster1 --cassandra-version 2.1.0
> Downloading 
> http://archive.apache.org/dist/cassandra/2.1.0/apache-cassandra-2.1.0-src.tar.gz
>  to /var/f

[jira] [Reopened] (CASSANDRA-7028) Allow C* to compile under java 8

2014-09-14 Thread Tupshin Harper (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tupshin Harper reopened CASSANDRA-7028:
---

> Allow C* to compile under java 8
> 
>
> Key: CASSANDRA-7028
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7028
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Dave Brosius
>Assignee: Aleksey Yeschenko
>Priority: Minor
> Fix For: 2.1.1, 3.0
>
> Attachments: 7028.txt, 7028_v2.txt, 7028_v3.txt, 7028_v4.txt, 
> 7028_v5.patch
>
>
> antlr 3.2 has a problem with java 8, as described here: 
> http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8015656
> updating to antlr 3.5.2 solves this, however they have split up the jars 
> differently, which adds some changes, but also the generation of 
> CqlParser.java causes a method to be too large, so i needed to split that 
> method to reduce the size of it.
> (patch against trunk)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-7936) Cassandra is not getting compiled on Java 1.8

2014-09-14 Thread Ramesh Mandaleeka (JIRA)
Ramesh Mandaleeka created CASSANDRA-7936:


 Summary: Cassandra is not getting compiled on Java 1.8
 Key: CASSANDRA-7936
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7936
 Project: Cassandra
  Issue Type: Bug
  Components: Core
 Environment: $ java -version

java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

$ ant -version
Apache Ant(TM) version 1.9.4 compiled on April 29 2014

Reporter: Ramesh Mandaleeka
 Fix For: 2.1.0


I'm trying to install a new cluster based on the following command and getting 
an error:
ccm create cluster1 --cassandra-version 2.1.0

Not sure if the issue is with ccm or cassandra.

gen-cql3-grammar:
[echo] Building Grammar 
/Users/ramesh/.ccm/repository/2.1.0/src/java/org/apache/cassandra/cql3/Cql.g ...
[java] error(10): internal error: Can't get property indirectDelegates using 
method get/isIndirectDelegates from org.antlr.tool.Grammar instance : 
java.lang.NullPointerException
[java] java.util.Objects.requireNonNull(Objects.java:203)
[java] java.util.ArrayList.removeAll(ArrayList.java:674)
[java] 
org.antlr.tool.CompositeGrammar.getIndirectDelegates(CompositeGrammar.java:222)
[java] org.antlr.tool.Grammar.getIndirectDelegates(Grammar.java:2620)
[java] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] java.lang.reflect.Method.invoke(Method.java:483)
[java] org.antlr.stringtemplate.language.ASTExpr.invokeMethod(ASTExpr.java:564)
[java] 
org.antlr.stringtemplate.language.ASTExpr.rawGetObjectProperty(ASTExpr.java:515)
[java] 
org.antlr.stringtemplate.language.ASTExpr.getObjectProperty(ASTExpr.java:417)
[java] 
org.antlr.stringtemplate.language.ActionEvaluator.attribute(ActionEvaluator.java:351)
[java] 
org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:136)
[java] 
org.antlr.stringtemplate.language.ActionEvaluator.templateApplication(ActionEvaluator.java:216)
[java] 
org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:126)
[java] 
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:84)
[java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
[java] org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
[java] org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
[java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
[java] 
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
[java] 
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
[java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
[java] org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
[java] org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
[java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
[java] 
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
[java] 
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
[java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
[java] org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
[java] org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
[java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
[java] 
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
[java] 
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
[java] org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
[java] org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
[java] org.antlr.codegen.CodeGenerator.write(CodeGenerator.java:1281)
[java] org.antlr.codegen.Target.genRecognizerFile(Target.java:94)
[java] org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:466)
[java] org.antlr.Tool.generateRecognizer(Tool.java:641)
[java] org.antlr.Tool.process(Tool.java:454)
[java] org.antlr.Tool.main(Tool.java:91)

BUILD FAILED
/Users/ramesh/.ccm/repository/2.1.0/build.xml:239: Java returned: 1


Error:
ccm create cluster1 --cassandra-version 2.1.0
Downloading 
http://archive.apache.org/dist/cassandra/2.1.0/apache-cassandra-2.1.0-src.tar.gz
 to /var/folders/f6/m11dxbgn7nn4j32bvg63y8pcgq/T/ccm-Cvfvb8.tar.gz 
(15.750MB)
16514874 [100.00%]
Extracting /var/folders/f6/m11dxbgn7nn4j32bvg63y8pcgq/T/ccm-Cvfvb8.tar.gz 
as version 2.1.0 ...
Compiling Cassandra 2.1.0 ...
Deleted /Users/ramesh/.ccm/repository/2.1.0 due to error
Traceback (most recent call last):
File "/usr/local/bin/ccm", line 5, in 
pkg_resou

[jira] [Comment Edited] (CASSANDRA-7566) DROP TABLE should also drop prepared statements associated to

2014-09-14 Thread Viju Kothuvatiparambil (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133309#comment-14133309
 ] 

Viju Kothuvatiparambil edited comment on CASSANDRA-7566 at 9/14/14 6:01 PM:


A patch to this issue is attached along with a test class. The QueryProcessor 
class now listens to the changes to schema, and cleanups prepared statements on 
drop keyspace and drop table events.  This is done by implementing 
IMigrationListener inside QueryProcessor and registering the listener with 
MigrationManager. This patch can be enhanced to fix the related issues, but 
this being my first contribution to Cassandra, I would like the experts to 
comment on it before I work on the others.  (My sincere thanks to Tylor Hobbs, 
Aleksey Yeschenko, Brandon Williams, Joshua McKenzie and Marcus Eriksson for 
helping me out at the Cassandra developer Bootcamp)


was (Author: vijuk):
A patch to this issue is attached along with a test class. The QueryProcessor 
class now listens to the changes to schema, and cleanups prepared statements on 
drop keyspace and drop table events.  This is done by implementing 
IMigrationListener inside QueryProcessor and registering the listener with 
MigrationManager. This patch can be enhanced to fix the related issues, but 
this being my first contribution to Cassandra, I would like the experts to 
comment on it before I work on the others.  (My sincere thanks to Tylor Hobbs, 
Aleksey Yeschenko and Brandon Williams, Joshua McKenzie and Marcus Eriksson for 
helping me out at the cassandra developer bootcamp)

> DROP TABLE should also drop prepared statements associated to
> -
>
> Key: CASSANDRA-7566
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7566
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: OSX 10.9.4 / JDK 1.8.0_05
>Reporter: Ben Hood
>Assignee: Yuki Morishita
>  Labels: cql3
> Fix For: 2.1.1
>
> Attachments: trunk-7566.txt
>
>
> An integration test suite that drops and creates the same column family 3 
> times causes the following error in the server log:
> INFO  15:40:34 Initializing gocql_test.wiki_page
> ERROR 15:40:34 Attempted to write commit log entry for unrecognized column 
> family: b0e167e0-0dc8-11e4-9cbb-29a4872887f2
> ERROR 15:40:34 Attempting to mutate non-existant column family 
> b0e167e0-0dc8-11e4-9cbb-29a4872887f2
> ERROR 15:40:34 Attempted to write commit log entry for unrecognized column 
> family: b0e167e0-0dc8-11e4-9cbb-29a4872887f2
> ERROR 15:40:34 Attempting to mutate non-existant column family 
> b0e167e0-0dc8-11e4-9cbb-29a4872887f2
> The test that reproduces this issue is here:
> https://github.com/gocql/gocql/blob/master/wiki_test.go
> Interestingly this issue only occurs after the common table is 
> dropped/created for the 3rd time. If only one of the tests is run on its own, 
> this issue does not arise.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7566) DROP TABLE should also drop prepared statements associated to

2014-09-14 Thread Viju Kothuvatiparambil (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7566?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Viju Kothuvatiparambil updated CASSANDRA-7566:
--
Attachment: trunk-7566.txt

A patch to this issue is attached along with a test class. The QueryProcessor 
class now listens to the changes to schema, and cleanups prepared statements on 
drop keyspace and drop table events.  This is done by implementing 
IMigrationListener inside QueryProcessor and registering the listener with 
MigrationManager. This patch can be enhanced to fix the related issues, but 
this being my first contribution to Cassandra, I would like the experts to 
comment on it before I work on the others.  (My sincere thanks to Tylor Hobbs, 
Aleksey Yeschenko and Brandon Williams, Joshua McKenzie and Marcus Eriksson for 
helping me out at the cassandra developer bootcamp)

> DROP TABLE should also drop prepared statements associated to
> -
>
> Key: CASSANDRA-7566
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7566
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: OSX 10.9.4 / JDK 1.8.0_05
>Reporter: Ben Hood
>Assignee: Yuki Morishita
>  Labels: cql3
> Fix For: 2.1.1
>
> Attachments: trunk-7566.txt
>
>
> An integration test suite that drops and creates the same column family 3 
> times causes the following error in the server log:
> INFO  15:40:34 Initializing gocql_test.wiki_page
> ERROR 15:40:34 Attempted to write commit log entry for unrecognized column 
> family: b0e167e0-0dc8-11e4-9cbb-29a4872887f2
> ERROR 15:40:34 Attempting to mutate non-existant column family 
> b0e167e0-0dc8-11e4-9cbb-29a4872887f2
> ERROR 15:40:34 Attempted to write commit log entry for unrecognized column 
> family: b0e167e0-0dc8-11e4-9cbb-29a4872887f2
> ERROR 15:40:34 Attempting to mutate non-existant column family 
> b0e167e0-0dc8-11e4-9cbb-29a4872887f2
> The test that reproduces this issue is here:
> https://github.com/gocql/gocql/blob/master/wiki_test.go
> Interestingly this issue only occurs after the common table is 
> dropped/created for the 3rd time. If only one of the tests is run on its own, 
> this issue does not arise.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[Cassandra Wiki] Update of "DebianPackaging" by MichaelShuler

2014-09-14 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for 
change notification.

The "DebianPackaging" page has been changed by MichaelShuler:
https://wiki.apache.org/cassandra/DebianPackaging?action=diff&rev1=32&rev2=33

  Alternatively, you can install directly from the ASF repositories:
  
  {{{
- deb http://www.apache.org/dist/cassandra/debian 11x main
+ deb http://www.apache.org/dist/cassandra/debian 21x main
- deb-src http://www.apache.org/dist/cassandra/debian 11x main
+ deb-src http://www.apache.org/dist/cassandra/debian 21x main
  }}}
  
- You will want to replace `11x` by the series you want to use: `10x for the 
1.0.x series, 08x for the 0.8.x series, etc... You will not automatically get 
major version updates unless you change the series, but that is ''a feature''.
+ You will want to replace `21x` by the series you want to use: `20x` for the 
2.0.x series, `12x` for the 1.2.x series, etc... You will not automatically get 
major version updates unless you change the series, but that is ''a feature''.
  
  
  If you run ''apt-get update'' now, you will see an error similar to this:


[jira] [Commented] (CASSANDRA-7837) Factor out static initialization / singletons

2014-09-14 Thread Blake Eggleston (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133265#comment-14133265
 ] 

Blake Eggleston commented on CASSANDRA-7837:


I've finished the second stage of the refactor. All non service/singleton 
classes are now instantiated with their dependencies, and don't use any static 
singletons.

I'd like to get some opinions on the best way to proceed from here.

In the code's current state, there are a lot of circular dependencies between 
the singletons. However, most of the dependencies aren't accessed in the 
singleton's constructor. I could wrap this up pretty quickly if I instantiated 
all of the services by passing the database descriptor instance into the 
constructor, and expose the other singletons via getter methods on the database 
descriptor. There are still be some hard dependencies needed by the singleton 
constructors, but most of the singletons are accessed at runtime inside various 
singleton methods.

This *would* be kind of ugly, and would be the bare minimum needed to remove 
static initialization from Cassandra. However, with a big refactor like this, 
there's something to be said for quickly delivering an mvp where things are in 
a less bad state, and continuing to improve upon it.

The alternative would be continuing to refactor the api to remove singleton 
interdependencies, but that will require much deeper changes.

Thoughts?

> Factor out static initialization / singletons
> -
>
> Key: CASSANDRA-7837
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7837
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Blake Eggleston
>Assignee: Blake Eggleston
>
> I've been spending some time experimenting with ways to factor out static 
> initialization and static singletons in Cassandra.
> This is a known issue, with obvious implications on testability and 
> extensibility. It also leads to subtle changes in behavior of the database 
> and tests, as access patterns to static methods reorder the initialization 
> order of the static state. For instance, the test 
> org.apache.cassandra.config.DatabaseDescriptorTest.testKSMetaDataSerialization
>  is no longer testing anything, because Schema.getKeyspaceDefinitions() is 
> now returning an empty array. Once the initialization order is changed, the 
> test fails because system keyspaces aren't being filtered out, and fromThrift 
> throws an exceptions when it sees LocalStrategy. Removing static state and 
> singletons will make testing each component in isolation easier, leading to 
> fewer regressions.
> With a large refactor like this, we'd want to avoid having the refactor 
> branch, and the trunk branch diverging too far, or for too long. After a few 
> failed attempts, I've worked out a way to perform the refactor in a way that 
> can be performed with a series of (relatively) small patches, and avoid a 
> big, scary merge. Each patch will build, the tests will pass, and can be 
> merged into trunk daily/regularly as they are completed.
> The process is as follows:
> # Condense all static state into static singletons. 
> (DatabaseDescriptor.getPartitioner() -> 
> DatabaseDescriptor.instance.getPartitioner())
> ** In some cases, classes will need to be split into pairs of instance and 
> factory classes, like in the case of Keyspace and ColumnFamilyStore
> # Identify all non-singleton usages of static state (grep for '.instance.'), 
> and refactor to pass dependencies into their constructors from their 
> instantiating services.
> # Work out and implement an initialization order for the singletons, 
> preferring final members passed into their constructor, using volatile 
> members assigned during startup where there are circular dependencies.
> ** We should consider splitting some of the singletons into more component 
> specific classes before this step. There is definitely a case for making that 
> another ticket, but with the non-singleton dependencies clearly defined at 
> this point, we will have a clear idea of what can be split up. Doing that 
> would reduce the number of circular dependencies between singletons, and make 
> this stage a lot easier, with the additional benefit of further modularizing 
> the code.
> # Remove static singleton instances. Initialize and start C* from a static 
> method that takes a configuration as an argument.
> ** CassandraDaemon and utilities will need to be updated, and we'll need a 
> helper method so tests can instantiate the database with a one or two liner.
> Obviously, this is a lot of work, but I think it's worth the effort. I've 
> already gone through a few practice runs, and it's doable. I'm happy to do 
> the work, with guidance and input from the C* team.
> Thoughts?



--
This message was sent by Atlassian JIRA
(v6.3.4

[jira] [Commented] (CASSANDRA-7842) Work out and implement an initialization order for singletons

2014-09-14 Thread Blake Eggleston (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133263#comment-14133263
 ] 

Blake Eggleston commented on CASSANDRA-7842:


Here's the singletons, and their dependencies: 
https://gist.github.com/bdeggleston/ef4acd659fafb2629fe1

> Work out and implement an initialization order for singletons
> -
>
> Key: CASSANDRA-7842
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7842
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Blake Eggleston
>Assignee: Blake Eggleston
>
> Prefer final members passed into their constructor, using volatile members 
> assigned during startup where there are circular dependencies.
> We should consider splitting some of the singletons into more component 
> specific classes before this step. There is definitely a case for making that 
> another ticket, but with the non-singleton dependencies clearly defined at 
> this point, we will have a clear idea of what can be split up. Doing that 
> would reduce the number of circular dependencies between singletons, and make 
> this stage a lot easier, with the additional benefit of further modularizing 
> the code.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7841) Pass static singleton instances into constructors of dependent classes

2014-09-14 Thread Blake Eggleston (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133262#comment-14133262
 ] 

Blake Eggleston commented on CASSANDRA-7841:


This step is finished. Diff is here: 
https://github.com/bdeggleston/cassandra/compare/C7840...C7841

> Pass static singleton instances into constructors of dependent classes
> --
>
> Key: CASSANDRA-7841
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7841
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Blake Eggleston
>Assignee: Blake Eggleston
>
> Identify all non-singleton usages of static state (grep for '.instance.'), 
> and refactor to pass dependencies into their constructors from their 
> instantiating services.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-7935) Make assassinate a first class command

2014-09-14 Thread Brandon Williams (JIRA)
Brandon Williams created CASSANDRA-7935:
---

 Summary: Make assassinate a first class command
 Key: CASSANDRA-7935
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7935
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Brandon Williams
Assignee: Brandon Williams
 Fix For: 3.0


Assassinate has proven itself as the top tier in the hierarchy of node removal. 
 It's time we removed the unsafe moniker and made it a nodetool command so 
people don't have to mess with JMX themselves when they need it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7838) Warn user when disks are network/ebs mounted

2014-09-14 Thread AMIT KUMAR (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133244#comment-14133244
 ] 

AMIT KUMAR commented on CASSANDRA-7838:
---

Thanks Joshua 
Here it is:  
https://github.com/kumaramit01/cassandra/tree/CASSANDRA-7838
comparison with the 2.1.0 branch
https://github.com/kumaramit01/cassandra/compare/CASSANDRA-7838

I am not entirely sure about the packaging process, the lib/sigar-bin folder 
with the native libraries needs to be part of the deployment. 

Let me know what I missed. 

Amit



> Warn user when disks are network/ebs mounted
> 
>
> Key: CASSANDRA-7838
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7838
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: T Jake Luciani
>Priority: Minor
>  Labels: lhf
> Fix For: 3.0
>
>
> The Sigar project let's you probe os/cpu/filesystems across the major 
> platforms.
> https://github.com/hyperic/sigar
> It would be nice on start-up to use this to warn users if they are running 
> with settings that will make them sad, like Network drive or EBS on Ec2.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (CASSANDRA-7705) Safer Resource Management

2014-09-14 Thread Benedict (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedict reassigned CASSANDRA-7705:
---

Assignee: Benedict

> Safer Resource Management
> -
>
> Key: CASSANDRA-7705
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7705
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
> Fix For: 3.0
>
>
> We've had a spate of bugs recently with bad reference counting. these can 
> have potentially dire consequences, generally either randomly deleting data 
> or giving us infinite loops. 
> Since in 2.1 we only reference count resources that are relatively expensive 
> and infrequently managed (or in places where this safety is probably not as 
> necessary, e.g. SerializingCache), we could without any negative consequences 
> (and only slight code complexity) introduce a safer resource management 
> scheme for these more expensive/infrequent actions.
> Basically, I propose when we want to acquire a resource we allocate an object 
> that manages the reference. This can only be released once; if it is released 
> twice, we fail immediately at the second release, reporting where the bug is 
> (rather than letting it continue fine until the next correct release corrupts 
> the count). The reference counter remains the same, but we obtain guarantees 
> that the reference count itself is never badly maintained, although code 
> using it could mistakenly release its own handle early (typically this is 
> only an issue when cleaning up after a failure, in which case under the new 
> scheme this would be an innocuous error)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (CASSANDRA-7915) Waiting for sync on the commit log could happen after writing to memtable

2014-09-14 Thread Benedict (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7915?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedict resolved CASSANDRA-7915.
-
Resolution: Not a Problem

We don't actually do very much work at all besides the BTree merge on apply, 
which we cannot help but delay until the last moment without risking the work 
being wasted. So there's very little work to save whilst maintaining the 
current behaviour wrt correctness.

> Waiting for sync on the commit log could happen after writing to memtable
> -
>
> Key: CASSANDRA-7915
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7915
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Branimir Lambov
>Priority: Minor
>
> Currently the sync wait is part of CommitLog.add, which is executed in whole 
> before any memtable write. The time for executing the latter is thus added on 
> top of the time for file sync, which seems unnecessary.
> Moving the wait to a call at the end of Keystore.apply should hide the 
> memtable write time and may improve performance, especially for the batch 
> sync strategy.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7738) Permit CL overuse to be explicitly bounded

2014-09-14 Thread Benedict (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedict updated CASSANDRA-7738:

Assignee: (was: Benedict)

> Permit CL overuse to be explicitly bounded
> --
>
> Key: CASSANDRA-7738
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7738
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Benedict
>Priority: Minor
> Fix For: 3.0
>
>
> As mentioned in CASSANDRA-7554, we do not currently offer any way to 
> explicitly bound CL growth, which can be problematic in some scenarios (e.g. 
> EC2 where the system drive is quite small). We should offer a configurable 
> amount of headroom, beyond which we stop accepting writes until the backlog 
> clears.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-7934) Remove FBUtilities.threadLocalRandom

2014-09-14 Thread Benedict (JIRA)
Benedict created CASSANDRA-7934:
---

 Summary: Remove FBUtilities.threadLocalRandom
 Key: CASSANDRA-7934
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7934
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Benedict
Assignee: Benedict
Priority: Minor
 Fix For: 2.1.1


We should use ThreadLocalRandom.current() instead, as it is not only more 
standard, it is considerably faster.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[2/3] git commit: ninja fix rethrow InterruptedException in cassandra-stress Timing.snap

2014-09-14 Thread benedict
ninja fix rethrow InterruptedException in cassandra-stress Timing.snap


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a6678a27
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a6678a27
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a6678a27

Branch: refs/heads/trunk
Commit: a6678a273d61b4db54e0b7afeeab8b1b0f7d82a1
Parents: eea042b
Author: Benedict Elliott Smith 
Authored: Sun Sep 14 13:50:38 2014 +0100
Committer: Benedict Elliott Smith 
Committed: Sun Sep 14 13:50:38 2014 +0100

--
 tools/stress/src/org/apache/cassandra/stress/util/Timing.java | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a6678a27/tools/stress/src/org/apache/cassandra/stress/util/Timing.java
--
diff --git a/tools/stress/src/org/apache/cassandra/stress/util/Timing.java 
b/tools/stress/src/org/apache/cassandra/stress/util/Timing.java
index f64a40b..9a5fa56 100644
--- a/tools/stress/src/org/apache/cassandra/stress/util/Timing.java
+++ b/tools/stress/src/org/apache/cassandra/stress/util/Timing.java
@@ -73,6 +73,8 @@ public class Timing
 }
 catch (Exception e)
 {
+if (e instanceof InterruptedException)
+throw (InterruptedException) e;
 throw new RuntimeException(e);
 }
 



[1/3] git commit: ninja fix rethrow InterruptedException in cassandra-stress Timing.snap

2014-09-14 Thread benedict
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 eea042b0b -> a6678a273
  refs/heads/trunk 14b1c9607 -> 58985409c


ninja fix rethrow InterruptedException in cassandra-stress Timing.snap


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a6678a27
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a6678a27
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a6678a27

Branch: refs/heads/cassandra-2.1
Commit: a6678a273d61b4db54e0b7afeeab8b1b0f7d82a1
Parents: eea042b
Author: Benedict Elliott Smith 
Authored: Sun Sep 14 13:50:38 2014 +0100
Committer: Benedict Elliott Smith 
Committed: Sun Sep 14 13:50:38 2014 +0100

--
 tools/stress/src/org/apache/cassandra/stress/util/Timing.java | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a6678a27/tools/stress/src/org/apache/cassandra/stress/util/Timing.java
--
diff --git a/tools/stress/src/org/apache/cassandra/stress/util/Timing.java 
b/tools/stress/src/org/apache/cassandra/stress/util/Timing.java
index f64a40b..9a5fa56 100644
--- a/tools/stress/src/org/apache/cassandra/stress/util/Timing.java
+++ b/tools/stress/src/org/apache/cassandra/stress/util/Timing.java
@@ -73,6 +73,8 @@ public class Timing
 }
 catch (Exception e)
 {
+if (e instanceof InterruptedException)
+throw (InterruptedException) e;
 throw new RuntimeException(e);
 }
 



[3/3] git commit: Merge branch 'cassandra-2.1' into trunk

2014-09-14 Thread benedict
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/58985409
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/58985409
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/58985409

Branch: refs/heads/trunk
Commit: 58985409c9e7883bd1362687413771dcbc90ccf7
Parents: 14b1c96 a6678a2
Author: Benedict Elliott Smith 
Authored: Sun Sep 14 13:51:08 2014 +0100
Committer: Benedict Elliott Smith 
Committed: Sun Sep 14 13:51:08 2014 +0100

--
 tools/stress/src/org/apache/cassandra/stress/util/Timing.java | 2 ++
 1 file changed, 2 insertions(+)
--




[jira] [Commented] (CASSANDRA-7926) Stress can OOM on merging of timing samples

2014-09-14 Thread Benedict (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133191#comment-14133191
 ] 

Benedict commented on CASSANDRA-7926:
-

Patch available 
[here|https://github.com/belliottsmith/cassandra/tree/7926-stressoom]

I've made a few small changes:
* The number of samples we collect/accumulate at any point are all now 
configurable with the \-samples setting
* When merging multiple samples, we no longer merge them altogether and _then_ 
downsample, but instead downsample as we merge, ensuring our memory use is 
bounded much lower
* Switched to ThreadLocalRandom instead of Random for generating probabilities 



> Stress can OOM on merging of timing samples
> ---
>
> Key: CASSANDRA-7926
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7926
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tools
>Reporter: Benedict
>Assignee: Benedict
>Priority: Minor
> Fix For: 2.1.1
>
>
> {noformat}
> Exception in thread "StressMetrics:2" java.lang.OutOfMemoryError: Java heap 
> space
> at java.util.Arrays.copyOf(Arrays.java:2343)
> at 
> org.apache.cassandra.stress.util.SampleOfLongs.merge(SampleOfLongs.java:76)
> at 
> org.apache.cassandra.stress.util.TimingInterval.merge(TimingInterval.java:95)
> at 
> org.apache.cassandra.stress.util.Timing.snapInterval(Timing.java:95)
> at 
> org.apache.cassandra.stress.StressMetrics.update(StressMetrics.java:124)
> at 
> org.apache.cassandra.stress.StressMetrics.access$200(StressMetrics.java:36)
> at 
> org.apache.cassandra.stress.StressMetrics$1.run(StressMetrics.java:72)
> at java.lang.Thread.run(Thread.java:744)
> {noformat}
> This is partially down to recently increasing the per-thread sample size, but 
> also because we allocate temporary space linear in size to total sample size 
> in all threads during merge. This can easily be avoided. We should also scale 
> per-thread sample size based on total number of threads, so we limit total 
> memory use.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7282) Faster Memtable map

2014-09-14 Thread Benedict (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133164#comment-14133164
 ] 

Benedict commented on CASSANDRA-7282:
-

Uploaded a version with updated comments 
[here|https://github.com/belliottsmith/cassandra/tree/7282-fastmemtablemap]

> Faster Memtable map
> ---
>
> Key: CASSANDRA-7282
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7282
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>  Labels: performance
> Fix For: 3.0
>
> Attachments: profile.yaml, reads.svg, run1.svg, writes.svg
>
>
> Currently we maintain a ConcurrentSkipLastMap of DecoratedKey -> Partition in 
> our memtables. Maintaining this is an O(lg(n)) operation; since the vast 
> majority of users use a hash partitioner, it occurs to me we could maintain a 
> hybrid ordered list / hash map. The list would impose the normal order on the 
> collection, but a hash index would live alongside as part of the same data 
> structure, simply mapping into the list and permitting O(1) lookups and 
> inserts.
> I've chosen to implement this initial version as a linked-list node per item, 
> but we can optimise this in future by storing fatter nodes that permit a 
> cache-line's worth of hashes to be checked at once,  further reducing the 
> constant factor costs for lookups.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7932) Corrupt SSTable Cleanup Leak Resources

2014-09-14 Thread Benedict (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedict updated CASSANDRA-7932:

Attachment: (was: 7932.txt)

> Corrupt SSTable Cleanup Leak Resources
> --
>
> Key: CASSANDRA-7932
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7932
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
> Fix For: 2.1.1
>
>
> CASSANDRA-7705, during the BlackingListingCompactionsTest, detected leaks. 
> I've tracked this down to DataTracker.removeUnreadableSSTables() , which does 
> not release the reference to any sstables from the tracker.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7932) Corrupt SSTable Cleanup Leak Resources

2014-09-14 Thread Benedict (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133155#comment-14133155
 ] 

Benedict commented on CASSANDRA-7932:
-

I was mistaken. Whilst that patch fixes what appears to be a leak we could 
encounter from the same code path, the actual leak was more involved. I've 
patched on top of the leak detection code for trunk, however if we get a thumbs 
up we can backport to 2.1

[Patch|https://github.com/belliottsmith/cassandra/tree/7932-corruptleak]

> Corrupt SSTable Cleanup Leak Resources
> --
>
> Key: CASSANDRA-7932
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7932
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
> Fix For: 2.1.1
>
> Attachments: 7932.txt
>
>
> CASSANDRA-7705, during the BlackingListingCompactionsTest, detected leaks. 
> I've tracked this down to DataTracker.removeUnreadableSSTables() , which does 
> not release the reference to any sstables from the tracker.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7692) Upgrade Cassandra Java Driver to 2.1

2014-09-14 Thread Robert Stupp (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Stupp updated CASSANDRA-7692:

Attachment: 7692-3.0v2.txt

> Upgrade Cassandra Java Driver to 2.1
> 
>
> Key: CASSANDRA-7692
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7692
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Robert Stupp
>Assignee: Robert Stupp
> Fix For: 3.0
>
> Attachments: 7692-2.1.txt, 7692-3.0.txt, 7692-3.0v2.txt
>
>
> UDFs (CASSANDRA-7563) requires Java Driver that supports User Types and new 
> collection features (at least Java Driver 2.1).
> May also be handled separately if e.g. Hadoop stuff requires this (follow-up 
> to CASSANDRA-7618).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7692) Upgrade Cassandra Java Driver to 2.1

2014-09-14 Thread Robert Stupp (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Stupp updated CASSANDRA-7692:

Attachment: (was: 7692-3.0v2.txt)

> Upgrade Cassandra Java Driver to 2.1
> 
>
> Key: CASSANDRA-7692
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7692
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Robert Stupp
>Assignee: Robert Stupp
> Fix For: 3.0
>
> Attachments: 7692-2.1.txt, 7692-3.0.txt, 7692-3.0v2.txt
>
>
> UDFs (CASSANDRA-7563) requires Java Driver that supports User Types and new 
> collection features (at least Java Driver 2.1).
> May also be handled separately if e.g. Hadoop stuff requires this (follow-up 
> to CASSANDRA-7618).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7692) Upgrade Cassandra Java Driver to 2.1

2014-09-14 Thread Robert Stupp (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Stupp updated CASSANDRA-7692:

Attachment: 7692-3.0v2.txt

updated patch to use cassandra-driver-code v2.1.1

> Upgrade Cassandra Java Driver to 2.1
> 
>
> Key: CASSANDRA-7692
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7692
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Robert Stupp
>Assignee: Robert Stupp
> Fix For: 3.0
>
> Attachments: 7692-2.1.txt, 7692-3.0.txt, 7692-3.0v2.txt
>
>
> UDFs (CASSANDRA-7563) requires Java Driver that supports User Types and new 
> collection features (at least Java Driver 2.1).
> May also be handled separately if e.g. Hadoop stuff requires this (follow-up 
> to CASSANDRA-7618).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7769) Implement pg-style dollar syntax for string constants

2014-09-14 Thread Robert Stupp (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Stupp updated CASSANDRA-7769:

Attachment: 7769v4.txt

New v4 patch that only allows '$$' in Cql.g. The patch also includes some minor 
CqlTester changes (Java7 + wrong err assert msg in assertRows, if result set is 
empty).

(for reference 
[https://github.com/snazy/cassandra/blob/7769-pg-str-with-marker/src/java/org/apache/cassandra/cql3/Cql.g#L1421|here]
 is the Cql.g that allows marker strings)

> Implement pg-style dollar syntax for string constants
> -
>
> Key: CASSANDRA-7769
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7769
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Robert Stupp
>Assignee: Robert Stupp
> Fix For: 3.0
>
> Attachments: 7769.txt, 7769v2.txt, 7769v3.txt, 7769v4.txt
>
>
> Follow-up of CASSANDRA-7740:
> {{$function$...$function$}} in addition to string style variant.
> See also 
> http://www.postgresql.org/docs/9.1/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-4914) Aggregation functions in CQL

2014-09-14 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-4914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133128#comment-14133128
 ] 

Robert Stupp commented on CASSANDRA-4914:
-

Nice work, [~blerer] :)

* Regarding {{COUNT(\*)}}/{{COUNT(1)}} - can you change/extend that to also 
allow {{COUNT(any_column)}} or even {{COUNT(func_call)}}? The v3 patch does not 
handle this.
* Can you add a test to check whether an aggregate works against a UDF and vice 
versa? E.g. some "sin" function: {{SELECT sin(max(a)) FROM foo}} or {{SELECT 
max(sin(a)) FROM foo}}
* The aggregate functions do only return their input type. Means: overflows are 
not handled. It's not a problem for the {{BigDecimal}}/{{BigInteger}} 
implementations but for all the others. Maybe it's better to do all sum+avg on 
the {{BigDecimal}}/{{BigInteger}} types and always return them - although it's 
slower, the result will be correct. As a nice side effect it could be possible 
to reduce the number of avg/sum implementations and let them extend some few 
impls.
* The implementations of the aggregate functions are sometimes declared using 
{{public static final}} and sometimes using {{public static}} - nice to have: 
make them look equal


> Aggregation functions in CQL
> 
>
> Key: CASSANDRA-4914
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4914
> Project: Cassandra
>  Issue Type: New Feature
>Reporter: Vijay
>Assignee: Benjamin Lerer
>  Labels: cql, docs
> Fix For: 3.0
>
> Attachments: CASSANDRA-4914-V2.txt, CASSANDRA-4914-V3.txt, 
> CASSANDRA-4914.txt
>
>
> The requirement is to do aggregation of data in Cassandra (Wide row of column 
> values of int, double, float etc).
> With some basic agree gate functions like AVG, SUM, Mean, Min, Max, etc (for 
> the columns within a row).
> Example:
> SELECT * FROM emp WHERE empID IN (130) ORDER BY deptID DESC;  
>   
>  empid | deptid | first_name | last_name | salary
> ---+++---+
>130 |  3 | joe| doe   |   10.1
>130 |  2 | joe| doe   |100
>130 |  1 | joe| doe   |  1e+03
>  
> SELECT sum(salary), empid FROM emp WHERE empID IN (130);  
>   
>  sum(salary) | empid
> -+
>1110.1|  130



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[1/3] git commit: cassandra-stress supports whitelist mode for node config

2014-09-14 Thread benedict
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 0e652e754 -> eea042b0b
  refs/heads/trunk 477c54c03 -> 14b1c9607


cassandra-stress supports whitelist mode for node config

patch by benedict; reviewed by tjake for CASSANDRA-7658


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/eea042b0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/eea042b0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/eea042b0

Branch: refs/heads/cassandra-2.1
Commit: eea042b0b0abfb09f60b672c8930a924c5d7f25b
Parents: 0e652e7
Author: Benedict Elliott Smith 
Authored: Sun Sep 14 09:13:18 2014 +0100
Committer: Benedict Elliott Smith 
Committed: Sun Sep 14 09:13:18 2014 +0100

--
 CHANGES.txt |  1 +
 .../cassandra/stress/settings/SettingsNode.java | 47 ++-
 .../stress/settings/StressSettings.java |  5 +-
 .../cassandra/stress/util/JavaDriverClient.java | 16 -
 .../stress/util/SmartThriftClient.java  | 62 ++--
 5 files changed, 106 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/eea042b0/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4c39f5c..7e18719 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.1
+ * cassandra-stress supports whitelist mode for node config
  * GCInspector more closely tracks GC; cassandra-stress and nodetool report it
  * nodetool won't output bogus ownership info without a keyspace 
(CASSANDRA-7173)
  * Add human readable option to nodetool commands (CASSANDRA-5433)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eea042b0/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
--
diff --git 
a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java 
b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
index 4fd7d34..30fe908 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
@@ -22,15 +22,20 @@ package org.apache.cassandra.stress.settings;
 
 
 import java.io.*;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 public class SettingsNode implements Serializable
 {
-
 public final List nodes;
+public final boolean isWhiteList;
 
 public SettingsNode(Options options)
 {
@@ -63,6 +68,41 @@ public class SettingsNode implements Serializable
 }
 else
 nodes = Arrays.asList(options.list.value().split(","));
+isWhiteList = options.whitelist.setByUser();
+}
+
+public Set resolveAll()
+{
+Set r = new HashSet<>();
+for (String node : nodes)
+{
+try
+{
+r.add(InetAddress.getByName(node));
+}
+catch (UnknownHostException e)
+{
+throw new RuntimeException(e);
+}
+}
+return r;
+}
+
+public Set resolveAll(int port)
+{
+Set r = new HashSet<>();
+for (String node : nodes)
+{
+try
+{
+r.add(new InetSocketAddress(InetAddress.getByName(node), 
port));
+}
+catch (UnknownHostException e)
+{
+throw new RuntimeException(e);
+}
+}
+return r;
 }
 
 public String randomNode()
@@ -77,13 +117,14 @@ public class SettingsNode implements Serializable
 
 public static final class Options extends GroupedOptions
 {
+final OptionSimple whitelist = new OptionSimple("whitelist", "", null, 
"Limit communications to the provided nodes", false);
 final OptionSimple file = new OptionSimple("file=", ".*", null, "Node 
file (one per line)", false);
-final OptionSimple list = new OptionSimple("", "[^=,]+(,[^=,]+)*", 
"localhost", "comma delimited list of hosts", false);
+final OptionSimple list = new OptionSimple("", "[^=,]+(,[^=,]+)*", 
"localhost", "comma delimited list of nodes", false);
 
 @Override
 public List options()
 {
-return Arrays.asList(file, list);
+return Arrays.asList(whitelist, file, list);
 }
 }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eea042b0/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java
---

[3/3] git commit: Merge branch 'cassandra-2.1' into trunk

2014-09-14 Thread benedict
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/14b1c960
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/14b1c960
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/14b1c960

Branch: refs/heads/trunk
Commit: 14b1c96072dfdfccb8c1a2c10e8feb4b8189846f
Parents: 477c54c eea042b
Author: Benedict Elliott Smith 
Authored: Sun Sep 14 09:13:44 2014 +0100
Committer: Benedict Elliott Smith 
Committed: Sun Sep 14 09:13:44 2014 +0100

--
 CHANGES.txt |  1 +
 .../cassandra/stress/settings/SettingsNode.java | 47 ++-
 .../stress/settings/StressSettings.java |  5 +-
 .../cassandra/stress/util/JavaDriverClient.java | 16 -
 .../stress/util/SmartThriftClient.java  | 62 ++--
 5 files changed, 106 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/14b1c960/CHANGES.txt
--
diff --cc CHANGES.txt
index e9d48e9,7e18719..1e08d3c
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,26 -1,5 +1,27 @@@
 +3.0
 + * Remove YamlFileNetworkTopologySnitch (CASSANDRA-7917)
 + * Support Java source code for user-defined functions (CASSANDRA-7562)
 + * Require arg types to disambiguate UDF drops (CASSANDRA-7812)
 + * Do anticompaction in groups (CASSANDRA-6851)
 + * Verify that UDF class methods are static (CASSANDRA-7781)
 + * Support pure user-defined functions (CASSANDRA-7395, 7740)
 + * Permit configurable timestamps with cassandra-stress (CASSANDRA-7416)
 + * Move sstable RandomAccessReader to nio2, which allows using the
 +   FILE_SHARE_DELETE flag on Windows (CASSANDRA-4050)
 + * Remove CQL2 (CASSANDRA-5918)
 + * Add Thrift get_multi_slice call (CASSANDRA-6757)
 + * Optimize fetching multiple cells by name (CASSANDRA-6933)
 + * Allow compilation in java 8 (CASSANDRA-7028)
 + * Make incremental repair default (CASSANDRA-7250)
 + * Enable code coverage thru JaCoCo (CASSANDRA-7226)
 + * Switch external naming of 'column families' to 'tables' (CASSANDRA-4369) 
 + * Shorten SSTable path (CASSANDRA-6962)
 + * Use unsafe mutations for most unit tests (CASSANDRA-6969)
 + * Fix race condition during calculation of pending ranges (CASSANDRA-7390)
 +
 +
  2.1.1
+  * cassandra-stress supports whitelist mode for node config
   * GCInspector more closely tracks GC; cassandra-stress and nodetool report it
   * nodetool won't output bogus ownership info without a keyspace 
(CASSANDRA-7173)
   * Add human readable option to nodetool commands (CASSANDRA-5433)



[2/3] git commit: cassandra-stress supports whitelist mode for node config

2014-09-14 Thread benedict
cassandra-stress supports whitelist mode for node config

patch by benedict; reviewed by tjake for CASSANDRA-7658


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/eea042b0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/eea042b0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/eea042b0

Branch: refs/heads/trunk
Commit: eea042b0b0abfb09f60b672c8930a924c5d7f25b
Parents: 0e652e7
Author: Benedict Elliott Smith 
Authored: Sun Sep 14 09:13:18 2014 +0100
Committer: Benedict Elliott Smith 
Committed: Sun Sep 14 09:13:18 2014 +0100

--
 CHANGES.txt |  1 +
 .../cassandra/stress/settings/SettingsNode.java | 47 ++-
 .../stress/settings/StressSettings.java |  5 +-
 .../cassandra/stress/util/JavaDriverClient.java | 16 -
 .../stress/util/SmartThriftClient.java  | 62 ++--
 5 files changed, 106 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/eea042b0/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4c39f5c..7e18719 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.1
+ * cassandra-stress supports whitelist mode for node config
  * GCInspector more closely tracks GC; cassandra-stress and nodetool report it
  * nodetool won't output bogus ownership info without a keyspace 
(CASSANDRA-7173)
  * Add human readable option to nodetool commands (CASSANDRA-5433)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eea042b0/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
--
diff --git 
a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java 
b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
index 4fd7d34..30fe908 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
@@ -22,15 +22,20 @@ package org.apache.cassandra.stress.settings;
 
 
 import java.io.*;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 public class SettingsNode implements Serializable
 {
-
 public final List nodes;
+public final boolean isWhiteList;
 
 public SettingsNode(Options options)
 {
@@ -63,6 +68,41 @@ public class SettingsNode implements Serializable
 }
 else
 nodes = Arrays.asList(options.list.value().split(","));
+isWhiteList = options.whitelist.setByUser();
+}
+
+public Set resolveAll()
+{
+Set r = new HashSet<>();
+for (String node : nodes)
+{
+try
+{
+r.add(InetAddress.getByName(node));
+}
+catch (UnknownHostException e)
+{
+throw new RuntimeException(e);
+}
+}
+return r;
+}
+
+public Set resolveAll(int port)
+{
+Set r = new HashSet<>();
+for (String node : nodes)
+{
+try
+{
+r.add(new InetSocketAddress(InetAddress.getByName(node), 
port));
+}
+catch (UnknownHostException e)
+{
+throw new RuntimeException(e);
+}
+}
+return r;
 }
 
 public String randomNode()
@@ -77,13 +117,14 @@ public class SettingsNode implements Serializable
 
 public static final class Options extends GroupedOptions
 {
+final OptionSimple whitelist = new OptionSimple("whitelist", "", null, 
"Limit communications to the provided nodes", false);
 final OptionSimple file = new OptionSimple("file=", ".*", null, "Node 
file (one per line)", false);
-final OptionSimple list = new OptionSimple("", "[^=,]+(,[^=,]+)*", 
"localhost", "comma delimited list of hosts", false);
+final OptionSimple list = new OptionSimple("", "[^=,]+(,[^=,]+)*", 
"localhost", "comma delimited list of nodes", false);
 
 @Override
 public List options()
 {
-return Arrays.asList(file, list);
+return Arrays.asList(whitelist, file, list);
 }
 }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eea042b0/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java
--
diff --git 
a/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java 
b/tools/stress/src/or

[jira] [Commented] (CASSANDRA-7916) Stress should collect and cross-cluster GC statistics

2014-09-14 Thread Benedict (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133127#comment-14133127
 ] 

Benedict commented on CASSANDRA-7916:
-

Committed, and created a new ticket for sprucing up the README (since it's 
completely stale, not just this that needs elaborating)

> Stress should collect and cross-cluster GC statistics
> -
>
> Key: CASSANDRA-7916
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7916
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tools
>Reporter: Benedict
>Assignee: Benedict
>Priority: Minor
> Fix For: 2.1.1
>
>
> It would be useful to see stress outputs deliver cross-cluster statistics, 
> the most useful being GC data. Some simple changes to GCInspector collect the 
> data, and can deliver to a nodetool request or to stress over JMX.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[3/3] git commit: Merge branch 'cassandra-2.1' into trunk

2014-09-14 Thread benedict
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/477c54c0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/477c54c0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/477c54c0

Branch: refs/heads/trunk
Commit: 477c54c03cb708911d2173a0730b189ad844e2da
Parents: 0808166 0e652e7
Author: Benedict Elliott Smith 
Authored: Sun Sep 14 09:09:57 2014 +0100
Committer: Benedict Elliott Smith 
Committed: Sun Sep 14 09:09:57 2014 +0100

--
 CHANGES.txt |   1 +
 .../apache/cassandra/service/GCInspector.java   |  83 -
 .../cassandra/service/GCInspectorMXBean.java|  25 
 .../org/apache/cassandra/tools/NodeProbe.java   |  11 +-
 .../org/apache/cassandra/tools/NodeTool.java|  15 +++
 .../apache/cassandra/stress/StressAction.java   |   2 +-
 .../apache/cassandra/stress/StressMetrics.java  |  60 --
 .../cassandra/stress/settings/SettingsPort.java |   3 +
 .../cassandra/stress/util/JmxCollector.java | 119 +++
 .../apache/cassandra/stress/util/Timing.java|  36 --
 10 files changed, 330 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/477c54c0/CHANGES.txt
--
diff --cc CHANGES.txt
index c35e5b2,4c39f5c..e9d48e9
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,26 -1,5 +1,27 @@@
 +3.0
 + * Remove YamlFileNetworkTopologySnitch (CASSANDRA-7917)
 + * Support Java source code for user-defined functions (CASSANDRA-7562)
 + * Require arg types to disambiguate UDF drops (CASSANDRA-7812)
 + * Do anticompaction in groups (CASSANDRA-6851)
 + * Verify that UDF class methods are static (CASSANDRA-7781)
 + * Support pure user-defined functions (CASSANDRA-7395, 7740)
 + * Permit configurable timestamps with cassandra-stress (CASSANDRA-7416)
 + * Move sstable RandomAccessReader to nio2, which allows using the
 +   FILE_SHARE_DELETE flag on Windows (CASSANDRA-4050)
 + * Remove CQL2 (CASSANDRA-5918)
 + * Add Thrift get_multi_slice call (CASSANDRA-6757)
 + * Optimize fetching multiple cells by name (CASSANDRA-6933)
 + * Allow compilation in java 8 (CASSANDRA-7028)
 + * Make incremental repair default (CASSANDRA-7250)
 + * Enable code coverage thru JaCoCo (CASSANDRA-7226)
 + * Switch external naming of 'column families' to 'tables' (CASSANDRA-4369) 
 + * Shorten SSTable path (CASSANDRA-6962)
 + * Use unsafe mutations for most unit tests (CASSANDRA-6969)
 + * Fix race condition during calculation of pending ranges (CASSANDRA-7390)
 +
 +
  2.1.1
+  * GCInspector more closely tracks GC; cassandra-stress and nodetool report it
   * nodetool won't output bogus ownership info without a keyspace 
(CASSANDRA-7173)
   * Add human readable option to nodetool commands (CASSANDRA-5433)
   * Don't try to set repairedAt on old sstables (CASSANDRA-7913)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/477c54c0/src/java/org/apache/cassandra/tools/NodeProbe.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/477c54c0/src/java/org/apache/cassandra/tools/NodeTool.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/477c54c0/tools/stress/src/org/apache/cassandra/stress/StressMetrics.java
--
diff --cc tools/stress/src/org/apache/cassandra/stress/StressMetrics.java
index 0ef5df1,9e8e961..3f6f9c6
--- a/tools/stress/src/org/apache/cassandra/stress/StressMetrics.java
+++ b/tools/stress/src/org/apache/cassandra/stress/StressMetrics.java
@@@ -27,9 -28,11 +28,11 @@@ import java.util.concurrent.CountDownLa
  import java.util.concurrent.ThreadFactory;
  import java.util.concurrent.TimeUnit;
  
 +import com.google.common.util.concurrent.Uninterruptibles;
  import org.apache.commons.lang3.time.DurationFormatUtils;
 -
  import org.apache.cassandra.concurrent.NamedThreadFactory;
+ import org.apache.cassandra.stress.settings.StressSettings;
+ import org.apache.cassandra.stress.util.JmxCollector;
  import org.apache.cassandra.stress.util.Timing;
  import org.apache.cassandra.stress.util.TimingInterval;
  import org.apache.cassandra.stress.util.Uncertainty;



[1/3] git commit: GCInspector more closely tracks GC; cassandra-stress and nodetool report it

2014-09-14 Thread benedict
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 d002c7edc -> 0e652e754
  refs/heads/trunk 080816637 -> 477c54c03


GCInspector more closely tracks GC; cassandra-stress and nodetool report it

patch by benedict; reviewed by tjake


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0e652e75
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0e652e75
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0e652e75

Branch: refs/heads/cassandra-2.1
Commit: 0e652e7548edbfda2dbf47ce2272bb707a14a089
Parents: d002c7e
Author: Benedict Elliott Smith 
Authored: Sun Sep 14 09:09:37 2014 +0100
Committer: Benedict Elliott Smith 
Committed: Sun Sep 14 09:09:37 2014 +0100

--
 CHANGES.txt |   1 +
 .../apache/cassandra/service/GCInspector.java   |  83 -
 .../cassandra/service/GCInspectorMXBean.java|  25 
 .../org/apache/cassandra/tools/NodeProbe.java   |  11 +-
 .../org/apache/cassandra/tools/NodeTool.java|  15 +++
 .../apache/cassandra/stress/StressAction.java   |   2 +-
 .../apache/cassandra/stress/StressMetrics.java  |  61 --
 .../cassandra/stress/settings/SettingsPort.java |   3 +
 .../cassandra/stress/util/JmxCollector.java | 119 +++
 .../apache/cassandra/stress/util/Timing.java|  36 --
 10 files changed, 331 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e652e75/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 6e029ab..4c39f5c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.1
+ * GCInspector more closely tracks GC; cassandra-stress and nodetool report it
  * nodetool won't output bogus ownership info without a keyspace 
(CASSANDRA-7173)
  * Add human readable option to nodetool commands (CASSANDRA-5433)
  * Don't try to set repairedAt on old sstables (CASSANDRA-7913)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e652e75/src/java/org/apache/cassandra/service/GCInspector.java
--
diff --git a/src/java/org/apache/cassandra/service/GCInspector.java 
b/src/java/org/apache/cassandra/service/GCInspector.java
index d04b250..c4bffac 100644
--- a/src/java/org/apache/cassandra/service/GCInspector.java
+++ b/src/java/org/apache/cassandra/service/GCInspector.java
@@ -22,6 +22,8 @@ import java.lang.management.MemoryUsage;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
 import javax.management.MBeanServer;
 import javax.management.Notification;
 import javax.management.NotificationListener;
@@ -35,11 +37,55 @@ import com.sun.management.GarbageCollectionNotificationInfo;
 import org.apache.cassandra.io.sstable.SSTableDeletingTask;
 import org.apache.cassandra.utils.StatusLogger;
 
-public class GCInspector implements NotificationListener
+public class GCInspector implements NotificationListener, GCInspectorMXBean
 {
+public static final String MBEAN_NAME = 
"org.apache.cassandra.service:type=GCInspector";
 private static final Logger logger = 
LoggerFactory.getLogger(GCInspector.class);
-final static long MIN_DURATION = 200;
-final static long MIN_DURATION_TPSTATS = 1000;
+final static long MIN_LOG_DURATION = 200;
+final static long MIN_LOG_DURATION_TPSTATS = 1000;
+
+static final class State
+{
+final double maxRealTimeElapsed;
+final double totalRealTimeElapsed;
+final double sumSquaresRealTimeElapsed;
+final double totalBytesReclaimed;
+final double count;
+final long startNanos;
+
+State(double extraElapsed, double extraBytes, State prev)
+{
+this.totalRealTimeElapsed = prev.totalRealTimeElapsed + 
extraElapsed;
+this.totalBytesReclaimed = prev.totalBytesReclaimed + extraBytes;
+this.sumSquaresRealTimeElapsed = prev.sumSquaresRealTimeElapsed + 
(extraElapsed * extraElapsed);
+this.startNanos = prev.startNanos;
+this.count = prev.count + 1;
+this.maxRealTimeElapsed = Math.max(prev.maxRealTimeElapsed, 
extraElapsed);
+}
+
+State()
+{
+count = maxRealTimeElapsed = sumSquaresRealTimeElapsed = 
totalRealTimeElapsed = totalBytesReclaimed = 0;
+startNanos = System.nanoTime();
+}
+}
+
+final AtomicReference state = new AtomicReference<>(new State());
+
+public GCInspector()
+{
+MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+
+try
+{
+mbs.registerMBean(this, new ObjectName(MBEAN

[2/3] git commit: GCInspector more closely tracks GC; cassandra-stress and nodetool report it

2014-09-14 Thread benedict
GCInspector more closely tracks GC; cassandra-stress and nodetool report it

patch by benedict; reviewed by tjake


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0e652e75
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0e652e75
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0e652e75

Branch: refs/heads/trunk
Commit: 0e652e7548edbfda2dbf47ce2272bb707a14a089
Parents: d002c7e
Author: Benedict Elliott Smith 
Authored: Sun Sep 14 09:09:37 2014 +0100
Committer: Benedict Elliott Smith 
Committed: Sun Sep 14 09:09:37 2014 +0100

--
 CHANGES.txt |   1 +
 .../apache/cassandra/service/GCInspector.java   |  83 -
 .../cassandra/service/GCInspectorMXBean.java|  25 
 .../org/apache/cassandra/tools/NodeProbe.java   |  11 +-
 .../org/apache/cassandra/tools/NodeTool.java|  15 +++
 .../apache/cassandra/stress/StressAction.java   |   2 +-
 .../apache/cassandra/stress/StressMetrics.java  |  61 --
 .../cassandra/stress/settings/SettingsPort.java |   3 +
 .../cassandra/stress/util/JmxCollector.java | 119 +++
 .../apache/cassandra/stress/util/Timing.java|  36 --
 10 files changed, 331 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e652e75/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 6e029ab..4c39f5c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.1
+ * GCInspector more closely tracks GC; cassandra-stress and nodetool report it
  * nodetool won't output bogus ownership info without a keyspace 
(CASSANDRA-7173)
  * Add human readable option to nodetool commands (CASSANDRA-5433)
  * Don't try to set repairedAt on old sstables (CASSANDRA-7913)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e652e75/src/java/org/apache/cassandra/service/GCInspector.java
--
diff --git a/src/java/org/apache/cassandra/service/GCInspector.java 
b/src/java/org/apache/cassandra/service/GCInspector.java
index d04b250..c4bffac 100644
--- a/src/java/org/apache/cassandra/service/GCInspector.java
+++ b/src/java/org/apache/cassandra/service/GCInspector.java
@@ -22,6 +22,8 @@ import java.lang.management.MemoryUsage;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
 import javax.management.MBeanServer;
 import javax.management.Notification;
 import javax.management.NotificationListener;
@@ -35,11 +37,55 @@ import com.sun.management.GarbageCollectionNotificationInfo;
 import org.apache.cassandra.io.sstable.SSTableDeletingTask;
 import org.apache.cassandra.utils.StatusLogger;
 
-public class GCInspector implements NotificationListener
+public class GCInspector implements NotificationListener, GCInspectorMXBean
 {
+public static final String MBEAN_NAME = 
"org.apache.cassandra.service:type=GCInspector";
 private static final Logger logger = 
LoggerFactory.getLogger(GCInspector.class);
-final static long MIN_DURATION = 200;
-final static long MIN_DURATION_TPSTATS = 1000;
+final static long MIN_LOG_DURATION = 200;
+final static long MIN_LOG_DURATION_TPSTATS = 1000;
+
+static final class State
+{
+final double maxRealTimeElapsed;
+final double totalRealTimeElapsed;
+final double sumSquaresRealTimeElapsed;
+final double totalBytesReclaimed;
+final double count;
+final long startNanos;
+
+State(double extraElapsed, double extraBytes, State prev)
+{
+this.totalRealTimeElapsed = prev.totalRealTimeElapsed + 
extraElapsed;
+this.totalBytesReclaimed = prev.totalBytesReclaimed + extraBytes;
+this.sumSquaresRealTimeElapsed = prev.sumSquaresRealTimeElapsed + 
(extraElapsed * extraElapsed);
+this.startNanos = prev.startNanos;
+this.count = prev.count + 1;
+this.maxRealTimeElapsed = Math.max(prev.maxRealTimeElapsed, 
extraElapsed);
+}
+
+State()
+{
+count = maxRealTimeElapsed = sumSquaresRealTimeElapsed = 
totalRealTimeElapsed = totalBytesReclaimed = 0;
+startNanos = System.nanoTime();
+}
+}
+
+final AtomicReference state = new AtomicReference<>(new State());
+
+public GCInspector()
+{
+MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+
+try
+{
+mbs.registerMBean(this, new ObjectName(MBEAN_NAME));
+}
+catch (Exception e)
+{
+throw new RuntimeException(e);
+}
+
+}
 
 public stat

[jira] [Created] (CASSANDRA-7933) Update cassandra-stress README

2014-09-14 Thread Benedict (JIRA)
Benedict created CASSANDRA-7933:
---

 Summary: Update cassandra-stress README
 Key: CASSANDRA-7933
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7933
 Project: Cassandra
  Issue Type: Task
Reporter: Benedict
Priority: Minor


There is a README in the tools/stress directory. It is completely out of date.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7282) Faster Memtable map

2014-09-14 Thread Benedict (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133122#comment-14133122
 ] 

Benedict commented on CASSANDRA-7282:
-

bq. I wouldn't even call this a hashCode to avoid the confusion, perhaps an 
"ordering key" or "ordering prefix"?

Creating an interface would be problematic, since we need to have our map key 
be a shared type for both CSLM keys and NBHOM keys. So I'm going to stick with 
the current situation.

If you meant from a purely documentation point of view, it is absolutely 
essential that the value is a _hash_, otherwise performance will be O\(n\^2\), 
so whilst it may be worth clarifying it is essential we call it a hashCode(). 

To elaborate on this in documentation, I've included the following extra comment

{quote}
This data structure essentially only works for keys that are first sorted by 
some hash value (and may then be sorted 
within those hashes arbitrarily), where a 32-bit prefix of the hash we sort by 
is returned by hashCode()
{quote}

> Faster Memtable map
> ---
>
> Key: CASSANDRA-7282
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7282
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>  Labels: performance
> Fix For: 3.0
>
> Attachments: profile.yaml, reads.svg, run1.svg, writes.svg
>
>
> Currently we maintain a ConcurrentSkipLastMap of DecoratedKey -> Partition in 
> our memtables. Maintaining this is an O(lg(n)) operation; since the vast 
> majority of users use a hash partitioner, it occurs to me we could maintain a 
> hybrid ordered list / hash map. The list would impose the normal order on the 
> collection, but a hash index would live alongside as part of the same data 
> structure, simply mapping into the list and permitting O(1) lookups and 
> inserts.
> I've chosen to implement this initial version as a linked-list node per item, 
> but we can optimise this in future by storing fatter nodes that permit a 
> cache-line's worth of hashes to be checked at once,  further reducing the 
> constant factor costs for lookups.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7932) Corrupt SSTable Cleanup Leak Resources

2014-09-14 Thread Benedict (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedict updated CASSANDRA-7932:

Attachment: 7932.txt

Patch attached

> Corrupt SSTable Cleanup Leak Resources
> --
>
> Key: CASSANDRA-7932
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7932
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
> Fix For: 2.1.1
>
> Attachments: 7932.txt
>
>
> CASSANDRA-7705, during the BlackingListingCompactionsTest, detected leaks. 
> I've tracked this down to DataTracker.removeUnreadableSSTables() , which does 
> not release the reference to any sstables from the tracker.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-7932) Corrupt SSTable Cleanup Leak Resources

2014-09-14 Thread Benedict (JIRA)
Benedict created CASSANDRA-7932:
---

 Summary: Corrupt SSTable Cleanup Leak Resources
 Key: CASSANDRA-7932
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7932
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Benedict
Assignee: Benedict
 Fix For: 2.1.1


CASSANDRA-7705, during the BlackingListingCompactionsTest, detected leaks. I've 
tracked this down to DataTracker.removeUnreadableSSTables() , which does not 
release the reference to any sstables from the tracker.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)