Permalink
Browse files

Custom CQL protocol

patch by slebresne; reviewed by yukim and norman for CASSANDRA-2478
  • Loading branch information...
pcmanus committed May 7, 2012
1 parent 1a89ea4 commit 6d3a3eed27af0b6dd398da5bdd342d5bbd5340c0
Showing with 4,482 additions and 736 deletions.
  1. +1 −1 bin/cassandra
  2. +1 −1 bin/cassandra.bat
  3. +65 −0 bin/debug-cql
  4. +1 −1 build.xml
  5. +17 −0 conf/cassandra.yaml
  6. +2 −2 debian/init
  7. +386 −0 doc/native_protocol.spec
  8. BIN lib/netty-3.5.2.Final.jar
  9. +0 −4 src/java/org/apache/cassandra/config/CFMetaData.java
  10. +6 −0 src/java/org/apache/cassandra/config/Config.java
  11. +45 −3 src/java/org/apache/cassandra/config/DatabaseDescriptor.java
  12. +9 −3 src/java/org/apache/cassandra/cql/QueryProcessor.java
  13. +13 −34 src/java/org/apache/cassandra/cql3/CFDefinition.java
  14. +2 −1 src/java/org/apache/cassandra/cql3/CQLStatement.java
  15. +43 −0 src/java/org/apache/cassandra/cql3/ColumnSpecification.java
  16. +24 −41 src/java/org/apache/cassandra/cql3/QueryProcessor.java
  17. +341 −0 src/java/org/apache/cassandra/cql3/ResultSet.java
  18. +12 −14 src/java/org/apache/cassandra/cql3/UntypedResultSet.java
  19. +1 −1 src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
  20. +1 −1 src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java
  21. +2 −1 src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
  22. +3 −3 src/java/org/apache/cassandra/cql3/statements/ParsedStatement.java
  23. +2 −1 src/java/org/apache/cassandra/cql3/statements/SchemaAlteringStatement.java
  24. +74 −115 src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
  25. +2 −1 src/java/org/apache/cassandra/cql3/statements/TruncateStatement.java
  26. +1 −1 src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
  27. +3 −2 src/java/org/apache/cassandra/cql3/statements/UseStatement.java
  28. +0 −412 src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
  29. +330 −17 src/java/org/apache/cassandra/service/CassandraDaemon.java
  30. +5 −0 src/java/org/apache/cassandra/service/ClientState.java
  31. +1 −1 src/java/org/apache/cassandra/service/EmbeddedCassandraService.java
  32. +34 −8 src/java/org/apache/cassandra/service/StorageService.java
  33. +4 −0 src/java/org/apache/cassandra/service/StorageServiceMBean.java
  34. +11 −30 src/java/org/apache/cassandra/thrift/CassandraServer.java
  35. +49 −34 src/java/org/apache/cassandra/thrift/{CassandraDaemon.java → ThriftServer.java}
  36. +2 −2 src/java/org/apache/cassandra/tools/StandaloneScrubber.java
  37. +26 −0 src/java/org/apache/cassandra/transport/CBCodec.java
  38. +173 −0 src/java/org/apache/cassandra/transport/CBUtil.java
  39. +188 −0 src/java/org/apache/cassandra/transport/Client.java
  40. +124 −0 src/java/org/apache/cassandra/transport/Connection.java
  41. +128 −0 src/java/org/apache/cassandra/transport/DataType.java
  42. +239 −0 src/java/org/apache/cassandra/transport/Frame.java
  43. +81 −0 src/java/org/apache/cassandra/transport/FrameCompressor.java
  44. +210 −0 src/java/org/apache/cassandra/transport/Message.java
  45. +121 −0 src/java/org/apache/cassandra/transport/OptionCodec.java
  46. +29 −0 src/java/org/apache/cassandra/transport/ProtocolException.java
  47. +40 −0 src/java/org/apache/cassandra/transport/RequestThreadPoolExecutor.java
  48. +175 −0 src/java/org/apache/cassandra/transport/Server.java
  49. +236 −0 src/java/org/apache/cassandra/transport/SimpleClient.java
  50. +65 −0 src/java/org/apache/cassandra/transport/messages/AuthenticateMessage.java
  51. +95 −0 src/java/org/apache/cassandra/transport/messages/CredentialsMessage.java
  52. +107 −0 src/java/org/apache/cassandra/transport/messages/ErrorMessage.java
  53. +106 −0 src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java
  54. +69 −0 src/java/org/apache/cassandra/transport/messages/OptionsMessage.java
  55. +76 −0 src/java/org/apache/cassandra/transport/messages/PrepareMessage.java
  56. +89 −0 src/java/org/apache/cassandra/transport/messages/QueryMessage.java
  57. +58 −0 src/java/org/apache/cassandra/transport/messages/ReadyMessage.java
  58. +313 −0 src/java/org/apache/cassandra/transport/messages/ResultMessage.java
  59. +162 −0 src/java/org/apache/cassandra/transport/messages/StartupMessage.java
  60. +78 −0 src/java/org/apache/cassandra/transport/messages/SupportedMessage.java
  61. +1 −1 test/unit/org/apache/cassandra/EmbeddedServer.java
View
@@ -148,7 +148,7 @@ launch_service()
args=`getopt vfhp:bD: "$@"`
eval set -- "$args"
-classname="org.apache.cassandra.thrift.CassandraDaemon"
+classname="org.apache.cassandra.service.CassandraDaemon"
while true; do
case "$1" in
View
@@ -25,7 +25,7 @@ pushd %~dp0..
if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD%
popd
-if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.thrift.CassandraDaemon
+if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.service.CassandraDaemon
if NOT DEFINED JAVA_HOME goto :err
REM ***** JAVA options *****
View
@@ -0,0 +1,65 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
+ # Locations (in order) to use when searching for an include file.
+ for include in /usr/share/cassandra/cassandra.in.sh \
+ /usr/local/share/cassandra/cassandra.in.sh \
+ /opt/cassandra/cassandra.in.sh \
+ "$HOME/.cassandra.in.sh" \
+ "`dirname $0`/cassandra.in.sh"; do
+ if [ -r "$include" ]; then
+ . "$include"
+ break
+ fi
+ done
+# ...otherwise, source the specified include.
+elif [ -r "$CASSANDRA_INCLUDE" ]; then
+ . "$CASSANDRA_INCLUDE"
+fi
+
+# Use JAVA_HOME if set, otherwise look for java in PATH
+if [ -n "$JAVA_HOME" ]; then
+ JAVA="$JAVA_HOME/bin/java"
+else
+ JAVA=java
+fi
+
+if [ -z "$CASSANDRA_CONF" -o -z "$CLASSPATH" ]; then
+ echo "You must set the CASSANDRA_CONF and CLASSPATH vars" >&2
+ exit 1
+fi
+
+if [ -f "$CASSANDRA_CONF/cassandra-env.sh" ]; then
+ . "$CASSANDRA_CONF/cassandra-env.sh"
+fi
+
+# Special-case path variables.
+case "`uname`" in
+ CYGWIN*)
+ CLASSPATH=`cygpath -p -w "$CLASSPATH"`
+ CASSANDRA_CONF=`cygpath -p -w "$CASSANDRA_CONF"`
+ ;;
+esac
+
+class="org.apache.cassandra.cql3.transport.Client"
+cassandra_parms="-Dlog4j.configuration=log4j-tools.properties"
+"$JAVA" $JVM_OPTS $cassandra_parms -cp "$CLASSPATH" "$class" $1 $2
+
+exit $?
+
+# vi:ai sw=4 ts=4 tw=0 et
View
@@ -648,7 +648,7 @@
<target name="test-run" depends="build"
description="Run in test mode. Not for production use!">
- <java classname="org.apache.cassandra.thrift.CassandraDaemon" fork="true">
+ <java classname="org.apache.cassandra.service.CassandraDaemon" fork="true">
<classpath>
<path refid="cassandra.classpath"/>
<pathelement location="${test.conf}"/>
View
@@ -271,6 +271,23 @@ listen_address: localhost
# Leaving this blank will set it to the same value as listen_address
# broadcast_address: 1.2.3.4
+
+# Whether to start the native transport server.
+# Currently, only the thrift server is started by default because the native
+# transport is considered beta.
+start_native_transport: false
+# The address to bind the CQL native transport to. The same remarks than for
+# rpc_address applies.
+native_transport_address: localhost
+# port for the CQL native transport to listen for clients on
+native_transport_port: 8000
+# The maximum of thread handling requests. The meaning is the same than
+# rpc_max_threads. The default is unlimited.
+#native_transport_max_threads: 2048
+
+
+# Whether to start the thrift rpc server.
+start_rpc: true
# The address to bind the Thrift RPC service to -- clients connect
# here. Unlike ListenAddress above, you *can* specify 0.0.0.0 here if
# you want Thrift to listen on all interfaces.
View
@@ -144,7 +144,7 @@ do_start()
-XX:HeapDumpPath="$cassandra_home/java_`date +%s`.hprof" \
-XX:ErrorFile="$cassandra_home/hs_err_`date +%s`.log" \
$JVM_OPTS \
- org.apache.cassandra.thrift.CassandraDaemon
+ org.apache.cassandra.service.CassandraDaemon
is_running && return 0
for tries in `seq $WAIT_FOR_START`; do
@@ -166,7 +166,7 @@ do_stop()
# other if a failure occurred
is_running || return 1
$JSVC -stop -home $JAVA_HOME -pidfile $PIDFILE \
- org.apache.cassandra.thrift.CassandraDaemon
+ org.apache.cassandra.service.CassandraDaemon
is_running && return 2 || return 0
}
Oops, something went wrong.

0 comments on commit 6d3a3ee

Please sign in to comment.