cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject git commit: remove vestiges of Thrift unframed mode patch by jbellis; reviewed by brandonwilliams for CASSANDRA-4729
Date Thu, 27 Sep 2012 20:25:22 GMT
Updated Branches:
  refs/heads/trunk a0d7d9713 -> 6ca75ef9b


remove vestiges of Thrift unframed mode
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-4729


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

Branch: refs/heads/trunk
Commit: 6ca75ef9ba0fff52741f25b1b1350a0c10f17b68
Parents: a0d7d97
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Sep 27 13:00:22 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Sep 27 15:25:07 2012 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 conf/cassandra.yaml                                |    2 --
 examples/hadoop_word_count/src/WordCountSetup.java |    7 +++----
 src/java/org/apache/cassandra/cli/CliMain.java     |    9 +--------
 src/java/org/apache/cassandra/cli/CliOptions.java  |    9 ---------
 .../org/apache/cassandra/cli/CliSessionState.java  |    1 -
 .../cassandra/config/DatabaseDescriptor.java       |    6 ++----
 .../org/apache/cassandra/thrift/ThriftServer.java  |    2 +-
 .../src/org/apache/cassandra/stress/Session.java   |   12 +-----------
 9 files changed, 9 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ca75ef9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f50f368..6d044af 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 1.2-beta2
+ * remove vestiges of Thrift unframed mode (CASSANDRA-4729)
  * optimize single-row PK lookups (CASSANDRA-4710)
  * adjust blockFor calculation to account for pending ranges due to node 
    movement (CASSANDRA-833)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ca75ef9/conf/cassandra.yaml
----------------------------------------------------------------------
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 058cd81..cbcb7b2 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -368,8 +368,6 @@ rpc_server_type: sync
 # rpc_recv_buff_size_in_bytes:
 
 # Frame size for thrift (maximum field length).
-# 0 disables TFramedTransport in favor of TSocket. This option
-# is deprecated; we strongly recommend using Framed mode.
 thrift_framed_transport_size_in_mb: 15
 
 # The max length of a thrift message, including all fields and

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ca75ef9/examples/hadoop_word_count/src/WordCountSetup.java
----------------------------------------------------------------------
diff --git a/examples/hadoop_word_count/src/WordCountSetup.java b/examples/hadoop_word_count/src/WordCountSetup.java
index e8711b2..6837bec 100644
--- a/examples/hadoop_word_count/src/WordCountSetup.java
+++ b/examples/hadoop_word_count/src/WordCountSetup.java
@@ -191,14 +191,13 @@ public class WordCountSetup
             logger.warn("cassandra.host or cassandra.port is not defined, using default");
         }
         return createConnection(System.getProperty("cassandra.host", "localhost"),
-                                Integer.valueOf(System.getProperty("cassandra.port", "9160")),
-                                Boolean.valueOf(System.getProperty("cassandra.framed", "true")));
+                                Integer.valueOf(System.getProperty("cassandra.port", "9160")));
     }
 
-    private static Cassandra.Client createConnection(String host, Integer port, boolean framed)
throws TTransportException
+    private static Cassandra.Client createConnection(String host, Integer port) throws TTransportException
     {
         TSocket socket = new TSocket(host, port);
-        TTransport trans = framed ? new TFramedTransport(socket) : socket;
+        TTransport trans = new TFramedTransport(socket);
         trans.open();
         TProtocol protocol = new TBinaryProtocol(trans);
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ca75ef9/src/java/org/apache/cassandra/cli/CliMain.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/CliMain.java b/src/java/org/apache/cassandra/cli/CliMain.java
index ac7a3c3..9a4edc9 100644
--- a/src/java/org/apache/cassandra/cli/CliMain.java
+++ b/src/java/org/apache/cassandra/cli/CliMain.java
@@ -61,14 +61,7 @@ public class CliMain
         if (transport != null)
             transport.close();
 
-        if (sessionState.framed)
-        {
-            transport = new TFramedTransport(socket);
-        }
-        else
-        {
-            transport = socket;
-        }
+        transport = new TFramedTransport(socket);
 
         TBinaryProtocol binaryProtocol = new TBinaryProtocol(transport, true, true);
         Cassandra.Client cassandraClient = new Cassandra.Client(binaryProtocol);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ca75ef9/src/java/org/apache/cassandra/cli/CliOptions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/CliOptions.java b/src/java/org/apache/cassandra/cli/CliOptions.java
index 647aa2d..b32833e 100644
--- a/src/java/org/apache/cassandra/cli/CliOptions.java
+++ b/src/java/org/apache/cassandra/cli/CliOptions.java
@@ -34,7 +34,6 @@ public class CliOptions
     // Command line options
     private static final String HOST_OPTION = "host";
     private static final String PORT_OPTION = "port";
-    private static final String UNFRAME_OPTION = "unframed";
     private static final String DEBUG_OPTION = "debug";
     private static final String USERNAME_OPTION = "username";
     private static final String PASSWORD_OPTION = "password";
@@ -67,7 +66,6 @@ public class CliOptions
 
         // options without argument
         options.addOption("B",  BATCH_OPTION,   "enabled batch mode (suppress output; errors
are fatal)");
-        options.addOption(null, UNFRAME_OPTION, "use cassandra server's unframed transport");
         options.addOption(null, DEBUG_OPTION,   "display stack-traces (NOTE: We print strack-traces
in the places where it makes sense even without --debug)");
         options.addOption("?",  HELP_OPTION,    "usage help");
         options.addOption("v",  VERBOSE_OPTION, "verbose output when using batch mode");
@@ -95,13 +93,6 @@ public class CliOptions
                 css.hostName = DEFAULT_HOST;
             }
 
-            // Look to see if frame has been specified
-            if (cmd.hasOption(UNFRAME_OPTION))
-            {
-                css.framed = false;
-            }
-
-            // Look to see if frame has been specified
             if (cmd.hasOption(DEBUG_OPTION))
             {
                 css.debug = true;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ca75ef9/src/java/org/apache/cassandra/cli/CliSessionState.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/CliSessionState.java b/src/java/org/apache/cassandra/cli/CliSessionState.java
index 1907c4b..a0ef4e2 100644
--- a/src/java/org/apache/cassandra/cli/CliSessionState.java
+++ b/src/java/org/apache/cassandra/cli/CliSessionState.java
@@ -30,7 +30,6 @@ public class CliSessionState
 
     public String  hostName;      // cassandra server name
     public int     thriftPort;    // cassandra server's thrift port
-    public boolean framed = true; // cassandra server's framed transport
     public boolean debug = false; // print stack traces when errors occur in the CLI
     public String  username;      // cassandra login name (if SimpleAuthenticator is used)
     public String  password;      // cassandra login password (if SimpleAuthenticator is
used)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ca75ef9/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index d479acb..5a5d98e 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -334,10 +334,8 @@ public class DatabaseDescriptor
             if (conf.thrift_framed_transport_size_in_mb <= 0)
                 throw new ConfigurationException("thrift_framed_transport_size_in_mb must
be positive");
 
-            if (conf.thrift_framed_transport_size_in_mb > 0 && conf.thrift_max_message_length_in_mb
< conf.thrift_framed_transport_size_in_mb)
-            {
-                throw new ConfigurationException("thrift_max_message_length_in_mb must be
greater than thrift_framed_transport_size_in_mb when using TFramedTransport");
-            }
+            if (conf.thrift_max_message_length_in_mb < conf.thrift_framed_transport_size_in_mb)
+                throw new ConfigurationException("thrift_max_message_length_in_mb must be
greater than thrift_framed_transport_size_in_mb");
 
             /* end point snitch */
             if (conf.endpoint_snitch == null)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ca75ef9/src/java/org/apache/cassandra/thrift/ThriftServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/ThriftServer.java b/src/java/org/apache/cassandra/thrift/ThriftServer.java
index 801f3b1..b104cfd 100644
--- a/src/java/org/apache/cassandra/thrift/ThriftServer.java
+++ b/src/java/org/apache/cassandra/thrift/ThriftServer.java
@@ -118,7 +118,7 @@ public class ThriftServer implements CassandraDaemon.Server
             int tFramedTransportSize = DatabaseDescriptor.getThriftFramedTransportSize();
             TTransportFactory inTransportFactory = new TFramedTransport.Factory(tFramedTransportSize);
             TTransportFactory outTransportFactory = new TFramedTransport.Factory(tFramedTransportSize);
-            logger.info("Using TFastFramedTransport with a max frame size of {} bytes.",
tFramedTransportSize);
+            logger.info("Using TFramedTransport with a max frame size of {} bytes.", tFramedTransportSize);
 
             if (DatabaseDescriptor.getRpcServerType().equalsIgnoreCase(SYNC))
             {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6ca75ef9/tools/stress/src/org/apache/cassandra/stress/Session.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/Session.java b/tools/stress/src/org/apache/cassandra/stress/Session.java
index 8148522..057b431 100644
--- a/tools/stress/src/org/apache/cassandra/stress/Session.java
+++ b/tools/stress/src/org/apache/cassandra/stress/Session.java
@@ -73,7 +73,6 @@ public class Session implements Serializable
         availableOptions.addOption("r",  "random",               false,  "Use random key
generator (STDEV will have no effect), default:false");
         availableOptions.addOption("f",  "file",                 true,   "Write output to
given file");
         availableOptions.addOption("p",  "port",                 true,   "Thrift port, default:9160");
-        availableOptions.addOption("m",  "unframed",             false,  "Use unframed transport,
default:false");
         availableOptions.addOption("o",  "operation",            true,   "Operation to perform
(INSERT, READ, RANGE_SLICE, INDEXED_RANGE_SLICE, MULTI_GET, COUNTER_ADD, COUNTER_GET), default:INSERT");
         availableOptions.addOption("u",  "supercolumns",         true,   "Number of super
columns per key, default:1");
         availableOptions.addOption("y",  "family-type",          true,   "Column Family Type
(Super, Standard), default:Standard");
@@ -107,7 +106,6 @@ public class Session implements Serializable
     private int cardinality      = 50;
     private String[] nodes       = new String[] { "127.0.0.1" };
     private boolean random       = false;
-    private boolean unframed     = false;
     private int retryTimes       = 10;
     private int port             = 9160;
     private int superColumns     = 1;
@@ -223,9 +221,6 @@ public class Session implements Serializable
             if (cmd.hasOption("p"))
                 port = Integer.parseInt(cmd.getOptionValue("p"));
 
-            if (cmd.hasOption("m"))
-                unframed = Boolean.parseBoolean(cmd.getOptionValue("m"));
-
             if (cmd.hasOption("o"))
                 operation = Stress.Operations.valueOf(cmd.getOptionValue("o").toUpperCase());
 
@@ -416,11 +411,6 @@ public class Session implements Serializable
         return columnSize;
     }
 
-    public boolean isUnframed()
-    {
-        return unframed;
-    }
-
     public int getColumnsPerKey()
     {
         return columns;
@@ -655,7 +645,7 @@ public class Session implements Serializable
         String currentNode = nodes[Stress.randomizer.nextInt(nodes.length)];
 
         TSocket socket = new TSocket(currentNode, port);
-        TTransport transport = (isUnframed()) ? socket : new TFramedTransport(socket);
+        TTransport transport = new TFramedTransport(socket);
         CassandraClient client = new CassandraClient(new TBinaryProtocol(transport));
 
         try


Mime
View raw message