From 0e272c233d050961fe79b94f333668b900d4fbbe Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 27 Aug 2014 10:08:18 -0500 Subject: [PATCH 1/2] Add ability to detect unofficial openjdk builds. Patch by brandonwilliams, reviewed by enigmacurry for CASSANDRA-7799 --- conf/cassandra-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/cassandra-env.sh b/conf/cassandra-env.sh index c4c8bd59ba..354442691c 100644 --- a/conf/cassandra-env.sh +++ b/conf/cassandra-env.sh @@ -90,7 +90,7 @@ calculate_heap_sizes() java_ver_output=`"${JAVA:-java}" -version 2>&1` -jvmver=`echo "$java_ver_output" | grep 'java version' | awk -F'"' 'NR==1 {print $2}'` +jvmver=`echo "$java_ver_output" | grep '[openjdk|java] version' | awk -F'"' 'NR==1 {print $2}'` JVM_VERSION=${jvmver%_*} JVM_PATCH_VERSION=${jvmver#*_} From 44a9d8cc689ffe9f3a5628a1e816730e75736bbf Mon Sep 17 00:00:00 2001 From: Aleksey Yeschenko Date: Wed, 27 Aug 2014 18:16:19 +0300 Subject: [PATCH 2/2] Ninja s/substract/subtract --- pylib/cqlshlib/helptopics.py | 2 +- src/java/org/apache/cassandra/cql3/Operation.java | 4 ++-- src/java/org/apache/cassandra/cql3/Sets.java | 2 +- test/unit/org/apache/cassandra/cql3/CollectionsTest.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pylib/cqlshlib/helptopics.py b/pylib/cqlshlib/helptopics.py index 9848c71ac9..34584ff119 100644 --- a/pylib/cqlshlib/helptopics.py +++ b/pylib/cqlshlib/helptopics.py @@ -388,7 +388,7 @@ class CQLHelpTopics(object): Counter columns can be incremented or decremented by an arbitrary numeric value though the assignment of an expression that adds or - substracts the value. + subtracts the value. """ def help_update_where(self): diff --git a/src/java/org/apache/cassandra/cql3/Operation.java b/src/java/org/apache/cassandra/cql3/Operation.java index ace466cb18..ebcb30b245 100644 --- a/src/java/org/apache/cassandra/cql3/Operation.java +++ b/src/java/org/apache/cassandra/cql3/Operation.java @@ -92,7 +92,7 @@ public abstract class Operation * This can be one of: * - Setting a value: c = v * - Setting an element of a collection: c[x] = v - * - An addition/substraction to a variable: c = c +/- v (where v can be a collection literal) + * - An addition/subtraction to a variable: c = c +/- v (where v can be a collection literal) * - An prepend operation: c = v + c */ public interface RawUpdate @@ -303,7 +303,7 @@ public abstract class Operation case SET: return new Sets.Discarder(receiver, value.prepare(keyspace, receiver)); case MAP: - // The value for a map substraction is actually a set + // The value for a map subtraction is actually a set ColumnSpecification vr = new ColumnSpecification(receiver.ksName, receiver.cfName, receiver.name, diff --git a/src/java/org/apache/cassandra/cql3/Sets.java b/src/java/org/apache/cassandra/cql3/Sets.java index 20d9ac5240..315d7d337a 100644 --- a/src/java/org/apache/cassandra/cql3/Sets.java +++ b/src/java/org/apache/cassandra/cql3/Sets.java @@ -282,7 +282,7 @@ public abstract class Sets } } - // Note that this is reused for Map substraction too (we substract a set from a map) + // Note that this is reused for Map subtraction too (we subtract a set from a map) public static class Discarder extends Operation { public Discarder(ColumnDefinition column, Term t) diff --git a/test/unit/org/apache/cassandra/cql3/CollectionsTest.java b/test/unit/org/apache/cassandra/cql3/CollectionsTest.java index 72a24f09cd..01e05f2d68 100644 --- a/test/unit/org/apache/cassandra/cql3/CollectionsTest.java +++ b/test/unit/org/apache/cassandra/cql3/CollectionsTest.java @@ -76,7 +76,7 @@ public class CollectionsTest extends CQLTester assertInvalid("UPDATE %s SET m = m + ? WHERE k = 0", list("a", "b")); assertInvalid("UPDATE %s SET m = m - [ 'a', 'b' ] WHERE k = 0"); assertInvalid("UPDATE %s SET m = m + ? WHERE k = 0", set("a", "b")); - // Note that we do allow substracting a set from a map, but not a map from a map + // Note that we do allow subtracting a set from a map, but not a map from a map // TODO: We should remove this 'if' once #7833 is resolved if (!usePrepared()) assertInvalid("UPDATE %s SET m = m - ? WHERE k = 0", map("a", "b", "c", "d"));