You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jm...@apache.org on 2014/08/11 23:37:29 UTC
[14/50] [abbrv] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk
Conflicts:
src/java/org/apache/cassandra/cql3/ErrorCollector.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/4a69811e
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/4a69811e
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/4a69811e
Branch: refs/heads/cassandra-2.1
Commit: 4a69811ee492ca6dcf98f0e5a6375d20e31ba49d
Parents: 5019182 72241f6
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Tue Aug 5 17:26:05 2014 -0500
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Tue Aug 5 17:26:05 2014 -0500
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../org/apache/cassandra/cql3/ErrorCollector.java | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/4a69811e/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 991331f,9ef6cc3..c8bb11b
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,20 -1,5 +1,21 @@@
+3.0
+ * 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
+ * Avoid IOOBE when building SyntaxError message snippet (CASSANDRA-7569)
* SSTableExport uses correct validator to create string representation of partition
keys (CASSANDRA-7498)
* Avoid NPEs when receiving type changes for an unknown keyspace (CASSANDRA-7689)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/4a69811e/src/java/org/apache/cassandra/cql3/ErrorCollector.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/ErrorCollector.java
index 40949de,cd628b8..ad0f703
--- a/src/java/org/apache/cassandra/cql3/ErrorCollector.java
+++ b/src/java/org/apache/cassandra/cql3/ErrorCollector.java
@@@ -160,34 -157,21 +160,49 @@@ public final class ErrorCollector imple
}
/**
+ * Checks if the specified tokens are valid.
+ *
+ * @param token the tokens to check
+ * @return <code>true</code> if all the specified tokens are valid ones,
+ * <code>false</code> otherwise.
+ */
+ private static boolean areTokensValid(Token... tokens)
+ {
+ for (Token token : tokens)
+ {
+ if (!isTokenValid(token))
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Checks that the specified token is valid.
+ *
+ * @param token the token to check
+ * @return <code>true</code> if it is considered as valid, <code>false</code> otherwise.
+ */
+ private static boolean isTokenValid(Token token)
+ {
+ return token.getLine() > 0 && token.getCharPositionInLine() >= 0;
+ }
+
+ /**
+ * Returns the index of the offending token. <p>In the case where the offending token is an extra
+ * character at the end, the index returned by the <code>TokenStream</code> might be after the last token.
+ * To avoid that problem we need to make sure that the index of the offending token is a valid index
+ * (one for which a token exist).</p>
+ *
+ * @param index the token index returned by the <code>TokenStream</code>
+ * @param size the <code>TokenStream</code> size
+ * @return the valid index of the offending token
+ */
+ private static int getOffendingTokenIndex(int index, int size)
+ {
+ return Math.min(index, size - 1);
+ }
+
+ /**
* Puts the specified token within square brackets.
*
* @param line the line containing the token