cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [01/26] cassandra git commit: Thrift removal
Date Tue, 13 Dec 2016 09:27:25 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk e8b8a9033 -> 4881d9c30


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaQuery.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaQuery.java b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaQuery.java
index 2764704..f0b332c 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaQuery.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaQuery.java
@@ -36,9 +36,6 @@ import org.apache.cassandra.stress.generate.*;
 import org.apache.cassandra.stress.report.Timer;
 import org.apache.cassandra.stress.settings.StressSettings;
 import org.apache.cassandra.stress.util.JavaDriverClient;
-import org.apache.cassandra.stress.util.ThriftClient;
-import org.apache.cassandra.thrift.CqlResult;
-import org.apache.cassandra.thrift.ThriftConversion;
 
 public class SchemaQuery extends SchemaStatement
 {
@@ -52,10 +49,10 @@ public class SchemaQuery extends SchemaStatement
     final Object[][] randomBuffer;
     final Random random = new Random();
 
-    public SchemaQuery(Timer timer, StressSettings settings, PartitionGenerator generator, SeedManager seedManager, Integer thriftId, PreparedStatement statement, ConsistencyLevel cl, ArgSelect argSelect)
+    public SchemaQuery(Timer timer, StressSettings settings, PartitionGenerator generator, SeedManager seedManager, PreparedStatement statement, ConsistencyLevel cl, ArgSelect argSelect)
     {
         super(timer, settings, new DataSpec(generator, seedManager, new DistributionFixed(1), settings.insert.rowPopulationRatio.get(), argSelect == ArgSelect.MULTIROW ? statement.getVariables().size() : 1), statement,
-              statement.getVariables().asList().stream().map(d -> d.getName()).collect(Collectors.toList()), thriftId, cl);
+              statement.getVariables().asList().stream().map(d -> d.getName()).collect(Collectors.toList()), cl);
         this.argSelect = argSelect;
         randomBuffer = new Object[argumentIndex.length][argumentIndex.length];
     }
@@ -78,24 +75,6 @@ public class SchemaQuery extends SchemaStatement
         }
     }
 
-    private class ThriftRun extends Runner
-    {
-        final ThriftClient client;
-
-        private ThriftRun(ThriftClient client)
-        {
-            this.client = client;
-        }
-
-        public boolean run() throws Exception
-        {
-            CqlResult rs = client.execute_prepared_cql3_query(thriftId, partitions.get(0).getToken(), thriftArgs(), ThriftConversion.toThrift(cl));
-            rowCount = rs.getRowsSize();
-            partitionCount = Math.min(1, rowCount);
-            return true;
-        }
-    }
-
     private int fillRandom()
     {
         int c = 0;
@@ -132,36 +111,9 @@ public class SchemaQuery extends SchemaStatement
         }
     }
 
-    List<ByteBuffer> thriftArgs()
-    {
-        switch (argSelect)
-        {
-            case MULTIROW:
-                List<ByteBuffer> args = new ArrayList<>();
-                int c = fillRandom();
-                for (int i = 0 ; i < argumentIndex.length ; i++)
-                {
-                    int argIndex = argumentIndex[i];
-                    args.add(spec.partitionGenerator.convert(argIndex, randomBuffer[argIndex < 0 ? 0 : random.nextInt(c)][i]));
-                }
-                return args;
-            case SAMEROW:
-                return thriftRowArgs(partitions.get(0).next());
-            default:
-                throw new IllegalStateException();
-        }
-    }
-
     @Override
     public void run(JavaDriverClient client) throws IOException
     {
         timeWithRetry(new JavaDriverRun(client));
     }
-
-    @Override
-    public void run(ThriftClient client) throws IOException
-    {
-        timeWithRetry(new ThriftRun(client));
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaStatement.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaStatement.java b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaStatement.java
index ca1f5fa..94df2c2 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaStatement.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaStatement.java
@@ -39,18 +39,16 @@ import org.apache.cassandra.stress.util.JavaDriverClient;
 public abstract class SchemaStatement extends PartitionOperation
 {
     final PreparedStatement statement;
-    final Integer thriftId;
     final ConsistencyLevel cl;
     final int[] argumentIndex;
     final Object[] bindBuffer;
     final ColumnDefinitions definitions;
 
     public SchemaStatement(Timer timer, StressSettings settings, DataSpec spec,
-                           PreparedStatement statement, List<String> bindNames, Integer thriftId, ConsistencyLevel cl)
+                           PreparedStatement statement, List<String> bindNames, ConsistencyLevel cl)
     {
         super(timer, settings, spec);
         this.statement = statement;
-        this.thriftId = thriftId;
         this.cl = cl;
         argumentIndex = new int[bindNames.size()];
         bindBuffer = new Object[argumentIndex.length];
@@ -82,11 +80,12 @@ public abstract class SchemaStatement extends PartitionOperation
         return statement.bind(bindBuffer);
     }
 
-    List<ByteBuffer> thriftRowArgs(Row row)
+    List<ByteBuffer> rowArgs(Row row)
     {
         List<ByteBuffer> args = new ArrayList<>();
         for (int i : argumentIndex)
-            args.add(spec.partitionGenerator.convert(i, row.get(i)));
+            args.add(spec.partitionGenerator.convert(i,
+                        row.get(i)));
         return args;
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/TokenRangeQuery.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/TokenRangeQuery.java b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/TokenRangeQuery.java
index f561f61..6379c87 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/TokenRangeQuery.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/TokenRangeQuery.java
@@ -42,7 +42,6 @@ import org.apache.cassandra.stress.generate.TokenRangeIterator;
 import org.apache.cassandra.stress.report.Timer;
 import org.apache.cassandra.stress.settings.StressSettings;
 import org.apache.cassandra.stress.util.JavaDriverClient;
-import org.apache.cassandra.stress.util.ThriftClient;
 
 public class TokenRangeQuery extends Operation
 {
@@ -218,34 +217,12 @@ public class TokenRangeQuery extends Operation
         return ret.toString();
     }
 
-    private static class ThriftRun extends Runner
-    {
-        final ThriftClient client;
-
-        private ThriftRun(ThriftClient client)
-        {
-            this.client = client;
-        }
-
-        public boolean run() throws Exception
-        {
-            throw new OperationNotSupportedException("Bulk read over thrift not supported");
-        }
-    }
-
-
     @Override
     public void run(JavaDriverClient client) throws IOException
     {
         timeWithRetry(new JavaDriverRun(client));
     }
 
-    @Override
-    public void run(ThriftClient client) throws IOException
-    {
-        timeWithRetry(new ThriftRun(client));
-    }
-
     public int ready(WorkManager workManager)
     {
         tokenRangeIterator.update();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/ValidatingSchemaQuery.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/ValidatingSchemaQuery.java b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/ValidatingSchemaQuery.java
index a731b99..e7d7d56 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/ValidatingSchemaQuery.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/ValidatingSchemaQuery.java
@@ -36,13 +36,7 @@ import org.apache.cassandra.stress.operations.PartitionOperation;
 import org.apache.cassandra.stress.report.Timer;
 import org.apache.cassandra.stress.settings.StressSettings;
 import org.apache.cassandra.stress.util.JavaDriverClient;
-import org.apache.cassandra.stress.util.ThriftClient;
-import org.apache.cassandra.thrift.Compression;
-import org.apache.cassandra.thrift.CqlResult;
-import org.apache.cassandra.thrift.CqlRow;
-import org.apache.cassandra.thrift.ThriftConversion;
 import org.apache.cassandra.utils.Pair;
-import org.apache.thrift.TException;
 
 public class ValidatingSchemaQuery extends PartitionOperation
 {
@@ -150,50 +144,6 @@ public class ValidatingSchemaQuery extends PartitionOperation
         }
     }
 
-    private class ThriftRun extends Runner
-    {
-        final ThriftClient client;
-
-        private ThriftRun(ThriftClient client, PartitionIterator iter)
-        {
-            super(iter);
-            this.client = client;
-        }
-
-        public boolean run() throws Exception
-        {
-            CqlResult rs = client.execute_prepared_cql3_query(statements[statementIndex].thriftId, partitions.get(0).getToken(), thriftArgs(), ThriftConversion.toThrift(cl));
-            int[] valueIndex = new int[rs.getSchema().name_types.size()];
-                for (int i = 0 ; i < valueIndex.length ; i++)
-                    valueIndex[i] = spec.partitionGenerator.indexOf(rs.fieldForId(i).getFieldName());
-            int r = 0;
-            if (!statements[statementIndex].inclusiveStart && iter.hasNext())
-                iter.next();
-            while (iter.hasNext())
-            {
-                Row expectedRow = iter.next();
-                if (!statements[statementIndex].inclusiveEnd && !iter.hasNext())
-                    break;
-
-                if (r == rs.num)
-                    return false;
-
-                rowCount++;
-                CqlRow actualRow = rs.getRows().get(r++);
-                for (int i = 0 ; i < actualRow.getColumnsSize() ; i++)
-                {
-                    ByteBuffer expectedValue = spec.partitionGenerator.convert(valueIndex[i], expectedRow.get(valueIndex[i]));
-                    ByteBuffer actualValue = actualRow.getColumns().get(i).value;
-                    if (!expectedValue.equals(actualValue))
-                        return false;
-                }
-            }
-            assert r == rs.num;
-            partitionCount = Math.min(1, rowCount);
-            return true;
-        }
-    }
-
     BoundStatement bind(int statementIndex)
     {
         int pkc = bounds.left.partitionKey.length;
@@ -204,32 +154,12 @@ public class ValidatingSchemaQuery extends PartitionOperation
         return statements[statementIndex].statement.bind(bindBuffer);
     }
 
-    List<ByteBuffer> thriftArgs()
-    {
-        List<ByteBuffer> args = new ArrayList<>();
-        int pkc = bounds.left.partitionKey.length;
-        for (int i = 0 ; i < pkc ; i++)
-            args.add(spec.partitionGenerator.convert(-i, bounds.left.partitionKey[i]));
-        int ccc = bounds.left.row.length;
-        for (int i = 0 ; i < ccc ; i++)
-            args.add(spec.partitionGenerator.convert(i, bounds.left.get(i)));
-        for (int i = 0 ; i < ccc ; i++)
-            args.add(spec.partitionGenerator.convert(i, bounds.right.get(i)));
-        return args;
-    }
-
     @Override
     public void run(JavaDriverClient client) throws IOException
     {
         timeWithRetry(new JavaDriverRun(client, partitions.get(0)));
     }
 
-    @Override
-    public void run(ThriftClient client) throws IOException
-    {
-        timeWithRetry(new ThriftRun(client, partitions.get(0)));
-    }
-
     public static class Factory
     {
         final ValidatingStatement[] statements;
@@ -310,13 +240,11 @@ public class ValidatingSchemaQuery extends PartitionOperation
     private static class ValidatingStatement
     {
         final PreparedStatement statement;
-        final Integer thriftId;
         final boolean inclusiveStart;
         final boolean inclusiveEnd;
-        private ValidatingStatement(PreparedStatement statement, Integer thriftId, boolean inclusiveStart, boolean inclusiveEnd)
+        private ValidatingStatement(PreparedStatement statement, boolean inclusiveStart, boolean inclusiveEnd)
         {
             this.statement = statement;
-            this.thriftId = thriftId;
             this.inclusiveStart = inclusiveStart;
             this.inclusiveEnd = inclusiveEnd;
         }
@@ -325,16 +253,7 @@ public class ValidatingSchemaQuery extends PartitionOperation
     private static ValidatingStatement prepare(StressSettings settings, String cql, boolean incLb, boolean incUb)
     {
         JavaDriverClient jclient = settings.getJavaDriverClient();
-        ThriftClient tclient = settings.getThriftClient();
         PreparedStatement statement = jclient.prepare(cql);
-        try
-        {
-            Integer thriftId = tclient.prepare_cql3_query(cql, Compression.NONE);
-            return new ValidatingStatement(statement, thriftId, incLb, incUb);
-        }
-        catch (TException e)
-        {
-            throw new RuntimeException(e);
-        }
+        return new ValidatingStatement(statement, incLb, incUb);
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/CliOption.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/CliOption.java b/tools/stress/src/org/apache/cassandra/stress/settings/CliOption.java
index 36284ab..018669a 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/CliOption.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/CliOption.java
@@ -30,7 +30,7 @@ public enum CliOption
     INSERT("Insert specific options relating to various methods for batching and splitting partition updates", SettingsInsert.helpPrinter()),
     COL("Column details such as size and count distribution, data generator, names, comparator and if super columns should be used", SettingsColumn.helpPrinter()),
     RATE("Thread count, rate limit or automatic mode (default is auto)", SettingsRate.helpPrinter()),
-    MODE("Thrift or CQL with options", SettingsMode.helpPrinter()),
+    MODE("CQL mode options", SettingsMode.helpPrinter()),
     ERRORS("How to handle errors when encountered during stress", SettingsErrors.helpPrinter()),
     SCHEMA("Replication settings, compression, compaction, etc.", SettingsSchema.helpPrinter()),
     NODE("Nodes to connect to", SettingsNode.helpPrinter()),

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionAPI.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionAPI.java b/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionAPI.java
index 942250f..554c16b 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionAPI.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionAPI.java
@@ -23,6 +23,6 @@ package org.apache.cassandra.stress.settings;
 
 public enum ConnectionAPI
 {
-    THRIFT, THRIFT_SMART, SIMPLE_NATIVE, JAVA_DRIVER_NATIVE
+    SIMPLE_NATIVE, JAVA_DRIVER_NATIVE
 }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionStyle.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionStyle.java b/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionStyle.java
index 6b408a9..1884cc8 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionStyle.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/ConnectionStyle.java
@@ -1,6 +1,4 @@
-package org.apache.cassandra.stress.settings;
 /*
- * 
  * 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
@@ -8,23 +6,21 @@ package org.apache.cassandra.stress.settings;
  * 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.
- * 
  */
-
+package org.apache.cassandra.stress.settings;
 
 public enum ConnectionStyle
 {
     CQL,
-    CQL_PREPARED,
-    THRIFT
+    CQL_PREPARED
 }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/Legacy.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/Legacy.java b/tools/stress/src/org/apache/cassandra/stress/settings/Legacy.java
index 70693af..f9cbe8e 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/Legacy.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/Legacy.java
@@ -51,7 +51,6 @@ public class Legacy implements Serializable
         availableOptions.addOption("s",  "stdev",                true,   "Standard Deviation for gaussian read key generation, default:0.1");
         availableOptions.addOption("r",  "random",               false,  "Use random key generator for read key generation (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("o",  "operation",            true,   "Operation to perform (WRITE, READ, READWRITE, RANGE_SLICE, INDEXED_RANGE_SLICE, MULTI_GET, COUNTERWRITE, COUNTER_GET), default:WRITE");
         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");
@@ -60,8 +59,6 @@ public class Legacy implements Serializable
         availableOptions.addOption("i",  "progress-interval",    true,   "Progress Report Interval (seconds), default:10");
         availableOptions.addOption("g",  "keys-per-call",        true,   "Number of keys to get_range_slices or multiget per call, default:1000");
         availableOptions.addOption("l",  "replication-factor",   true,   "Replication Factor to use when creating needed column families, default:1");
-        availableOptions.addOption("L3", "enable-cql3",          false,  "Perform queries using CQL3 (Cassandra Query Language v 3.0.0)");
-        availableOptions.addOption("b",  "enable-native-protocol",  false,  "Use the binary native protocol (only work along with -L3)");
         availableOptions.addOption("P",  "use-prepared-statements", false, "Perform queries using prepared statements (only applicable to CQL).");
         availableOptions.addOption("e",  "consistency-level",    true,   "Consistency Level to use (ONE, QUORUM, LOCAL_QUORUM, EACH_QUORUM, ALL, ANY), default:ONE");
         availableOptions.addOption("x",  "create-index",         true,   "Type of index to create on needed column families (KEYS)");
@@ -73,7 +70,6 @@ public class Legacy implements Serializable
         availableOptions.addOption("Q",  "query-names",          true,   "Comma-separated list of column names to retrieve from each row.");
         availableOptions.addOption("Z",  "compaction-strategy",  true,   "CompactionStrategy to use.");
         availableOptions.addOption("U",  "comparator",           true,   "Column Comparator to use. Currently supported types are: TimeUUIDType, AsciiType, UTF8Type.");
-        availableOptions.addOption("tf", "transport-factory",    true,   "Fully-qualified TTransportFactory class name for creating a connection. Note: For Thrift over SSL, use org.apache.cassandra.stress.SSLTransportFactory.");
         availableOptions.addOption("ns", "no-statistics",        false,  "Turn off the aggegate statistics that is normally output after completion.");
         availableOptions.addOption("ts", SSL_TRUSTSTORE,         true, "SSL: full path to truststore");
         availableOptions.addOption("tspw", SSL_TRUSTSTORE_PW,    true, "SSL: full path to truststore");
@@ -231,10 +227,7 @@ public class Legacy implements Serializable
                 r.add("-schema", "replication(" + rep + ")");
             }
 
-            if (cmd.hasOption("L3"))
-                r.add("-mode", (cmd.hasOption("P") ? "prepared" : "") + (cmd.hasOption("b") ? "native" : "") +  "cql3");
-            else
-                r.add("-mode", "thrift");
+            r.add("-mode", (cmd.hasOption("P") ? "prepared" : "") + "native" +  "cql3");
 
             if (cmd.hasOption("I"))
                 r.add("-schema", "compression=" + cmd.getOptionValue("I"));
@@ -255,9 +248,6 @@ public class Legacy implements Serializable
             if (cmd.hasOption("ns"))
                 r.add("-log", "no-summary");
 
-            if (cmd.hasOption("tf"))
-                r.add("-transport", "factory=" + cmd.getOptionValue("tf"));
-
             if(cmd.hasOption(SSL_TRUSTSTORE))
                 r.add("-transport", "truststore=" + cmd.getOptionValue(SSL_TRUSTSTORE));
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/SettingsColumn.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsColumn.java b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsColumn.java
index 79d8d25..0ba2212 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsColumn.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsColumn.java
@@ -41,7 +41,6 @@ import org.apache.cassandra.utils.ByteBufferUtil;
  */
 public class SettingsColumn implements Serializable
 {
-
     public final int maxColumnsPerKey;
     public transient List<ByteBuffer> names;
     public final List<String> namestrs;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java
index 1416b8b..0442e1c 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java
@@ -32,7 +32,7 @@ import com.google.common.util.concurrent.Uninterruptibles;
 import org.apache.cassandra.stress.operations.OpDistributionFactory;
 import org.apache.cassandra.stress.util.JavaDriverClient;
 import org.apache.cassandra.stress.util.ResultLogger;
-import org.apache.cassandra.thrift.ConsistencyLevel;
+import org.apache.cassandra.db.ConsistencyLevel;
 
 // Generic command settings - common to read/write/etc
 public abstract class SettingsCommand implements Serializable

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/SettingsMode.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsMode.java b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsMode.java
index bebfa5f..b7c99c6 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsMode.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsMode.java
@@ -60,7 +60,7 @@ public class SettingsMode implements Serializable
             protocolVersion = "NEWEST_SUPPORTED".equals(opts.protocolVersion.value())
                     ? ProtocolVersion.NEWEST_SUPPORTED
                     : ProtocolVersion.fromInt(Integer.parseInt(opts.protocolVersion.value()));
-            api = opts.mode().displayPrefix.equals("native") ? ConnectionAPI.JAVA_DRIVER_NATIVE : ConnectionAPI.THRIFT;
+            api = ConnectionAPI.JAVA_DRIVER_NATIVE;
             style = opts.useUnPrepared.setByUser() ? ConnectionStyle.CQL :  ConnectionStyle.CQL_PREPARED;
             compression = ProtocolOptions.Compression.valueOf(opts.useCompression.value().toUpperCase()).name();
             username = opts.user.value();
@@ -110,21 +110,6 @@ public class SettingsMode implements Serializable
             maxPendingPerConnection = null;
             connectionsPerHost = null;
         }
-        else if (options instanceof ThriftOptions)
-        {
-            ThriftOptions opts = (ThriftOptions) options;
-            protocolVersion = ProtocolVersion.NEWEST_SUPPORTED;
-            cqlVersion = CqlVersion.NOCQL;
-            api = opts.smart.setByUser() ? ConnectionAPI.THRIFT_SMART : ConnectionAPI.THRIFT;
-            style = ConnectionStyle.THRIFT;
-            compression = ProtocolOptions.Compression.NONE.name();
-            username = opts.user.value();
-            password = opts.password.value();
-            authProviderClassname = null;
-            authProvider = null;
-            maxPendingPerConnection = null;
-            connectionsPerHost = null;
-        }
         else
             throw new IllegalStateException();
     }
@@ -145,15 +130,6 @@ public class SettingsMode implements Serializable
         }
     }
 
-    private static final class Cql3ThriftOptions extends Cql3Options
-    {
-        final OptionSimple mode = new OptionSimple("thrift", "", null, "", true);
-        OptionSimple mode()
-        {
-            return mode;
-        }
-    }
-
     private static abstract class Cql3Options extends GroupedOptions
     {
         final OptionSimple api = new OptionSimple("cql3", "", null, "", true);
@@ -176,7 +152,6 @@ public class SettingsMode implements Serializable
         }
     }
 
-
     private static final class Cql3SimpleNativeOptions extends GroupedOptions
     {
         final OptionSimple api = new OptionSimple("cql3", "", null, "", true);
@@ -191,21 +166,6 @@ public class SettingsMode implements Serializable
         }
     }
 
-    private static final class ThriftOptions extends GroupedOptions
-    {
-        final OptionSimple api = new OptionSimple("thrift", "", null, "", true);
-        final OptionSimple smart = new OptionSimple("smart", "", null, "", false);
-        final OptionSimple user = new OptionSimple("user=", ".+", null, "username", false);
-        final OptionSimple password = new OptionSimple("password=", ".+", null, "password", false);
-
-
-        @Override
-        public List<? extends Option> options()
-        {
-            return Arrays.asList(api, smart, user, password);
-        }
-    }
-
     // CLI Utility Methods
     public void printSettings(ResultLogger out)
     {
@@ -235,7 +195,7 @@ public class SettingsMode implements Serializable
             return new SettingsMode(opts);
         }
 
-        GroupedOptions options = GroupedOptions.select(params, new ThriftOptions(), new Cql3NativeOptions(), new Cql3SimpleNativeOptions());
+        GroupedOptions options = GroupedOptions.select(params, new Cql3NativeOptions(), new Cql3SimpleNativeOptions());
         if (options == null)
         {
             printHelp();
@@ -247,7 +207,7 @@ public class SettingsMode implements Serializable
 
     public static void printHelp()
     {
-        GroupedOptions.printOptions(System.out, "-mode", new ThriftOptions(), new Cql3NativeOptions(), new Cql3SimpleNativeOptions());
+        GroupedOptions.printOptions(System.out, "-mode", new Cql3NativeOptions(), new Cql3SimpleNativeOptions());
     }
 
     public static Runnable helpPrinter()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/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 95339e3..ef20092 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java
@@ -74,7 +74,6 @@ public class SettingsNode implements Serializable
         Set<String> r = new HashSet<>();
         switch (settings.mode.api)
         {
-            case THRIFT_SMART:
             case JAVA_DRIVER_NATIVE:
                 if (!isWhiteList)
                 {
@@ -82,7 +81,6 @@ public class SettingsNode implements Serializable
                         r.add(host.getAddress().getHostName());
                     break;
                 }
-            case THRIFT:
             case SIMPLE_NATIVE:
                 for (InetAddress address : resolveAllSpecified())
                     r.add(address.getHostName());

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/SettingsPort.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsPort.java b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsPort.java
index 73a4fb4..086df41 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsPort.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsPort.java
@@ -32,13 +32,11 @@ public class SettingsPort implements Serializable
 {
 
     public final int nativePort;
-    public final int thriftPort;
     public final int jmxPort;
 
     public SettingsPort(PortOptions options)
     {
         nativePort = Integer.parseInt(options.nativePort.value());
-        thriftPort = Integer.parseInt(options.thriftPort.value());
         jmxPort = Integer.parseInt(options.jmxPort.value());
     }
 
@@ -47,13 +45,12 @@ public class SettingsPort implements Serializable
     private static final class PortOptions extends GroupedOptions
     {
         final OptionSimple nativePort = new OptionSimple("native=", "[0-9]+", "9042", "Use this port for the Cassandra native protocol", false);
-        final OptionSimple thriftPort = new OptionSimple("thrift=", "[0-9]+", "9160", "Use this port for the thrift protocol", false);
         final OptionSimple jmxPort = new OptionSimple("jmx=", "[0-9]+", "7199", "Use this port for retrieving statistics over jmx", false);
 
         @Override
         public List<? extends Option> options()
         {
-            return Arrays.asList(nativePort, thriftPort, jmxPort);
+            return Arrays.asList(nativePort, jmxPort);
         }
     }
 
@@ -61,7 +58,6 @@ public class SettingsPort implements Serializable
     public void printSettings(ResultLogger out)
     {
         out.printf("  Native Port: %d%n", nativePort);
-        out.printf("  Thrift Port: %d%n", thriftPort);
         out.printf("  JMX Port: %d%n", jmxPort);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/SettingsSchema.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsSchema.java b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsSchema.java
index fc65c9a..aa321a3 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsSchema.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsSchema.java
@@ -28,7 +28,6 @@ import java.util.*;
 import com.datastax.driver.core.exceptions.AlreadyExistsException;
 import org.apache.cassandra.stress.util.JavaDriverClient;
 import org.apache.cassandra.stress.util.ResultLogger;
-import org.apache.cassandra.thrift.*;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
 public class SettingsSchema implements Serializable
@@ -58,22 +57,10 @@ public class SettingsSchema implements Serializable
         compactionStrategyOptions = options.compaction.getOptions();
     }
 
-    public void createKeySpaces(StressSettings settings)
-    {
-        if (settings.mode.api != ConnectionAPI.JAVA_DRIVER_NATIVE)
-        {
-            createKeySpacesThrift(settings);
-        }
-        else
-        {
-            createKeySpacesNative(settings);
-        }
-    }
-
     /**
      * Create Keyspace with Standard and Super/Counter column families
      */
-    public void createKeySpacesNative(StressSettings settings)
+    public void createKeySpaces(StressSettings settings)
     {
 
         JavaDriverClient client  = settings.getJavaDriverClient(false);
@@ -214,75 +201,6 @@ public class SettingsSchema implements Serializable
         return b.toString();
     }
 
-    /**
-     * Create Keyspace with Standard and Super/Counter column families
-     */
-    public void createKeySpacesThrift(StressSettings settings)
-    {
-        KsDef ksdef = new KsDef();
-
-        // column family for standard columns
-        CfDef standardCfDef = new CfDef(keyspace, "standard1");
-        Map<String, String> compressionOptions = new HashMap<>();
-        if (compression != null)
-            compressionOptions.put("sstable_compression", compression);
-
-        String comparator = settings.columns.comparator;
-        standardCfDef.setComparator_type(comparator)
-                .setDefault_validation_class(DEFAULT_VALIDATOR)
-                .setCompression_options(compressionOptions);
-
-        for (int i = 0; i < settings.columns.names.size(); i++)
-            standardCfDef.addToColumn_metadata(new ColumnDef(settings.columns.names.get(i), "BytesType"));
-
-        // column family for standard counters
-        CfDef counterCfDef = new CfDef(keyspace, "counter1")
-                .setComparator_type(comparator)
-                .setDefault_validation_class("CounterColumnType")
-                .setCompression_options(compressionOptions);
-
-        ksdef.setName(keyspace);
-        ksdef.setStrategy_class(replicationStrategy);
-
-        if (!replicationStrategyOptions.isEmpty())
-        {
-            ksdef.setStrategy_options(replicationStrategyOptions);
-        }
-
-        if (compactionStrategy != null)
-        {
-            standardCfDef.setCompaction_strategy(compactionStrategy);
-            counterCfDef.setCompaction_strategy(compactionStrategy);
-            if (!compactionStrategyOptions.isEmpty())
-            {
-                standardCfDef.setCompaction_strategy_options(compactionStrategyOptions);
-                counterCfDef.setCompaction_strategy_options(compactionStrategyOptions);
-            }
-        }
-
-        ksdef.setCf_defs(new ArrayList<>(Arrays.asList(standardCfDef, counterCfDef)));
-
-        Cassandra.Client client = settings.getRawThriftClient(false);
-
-        try
-        {
-            client.system_add_keyspace(ksdef);
-            client.set_keyspace(keyspace);
-
-            System.out.println(String.format("Created keyspaces. Sleeping %ss for propagation.", settings.node.nodes.size()));
-            Thread.sleep(settings.node.nodes.size() * 1000L); // seconds
-        }
-        catch (InvalidRequestException e)
-        {
-            System.err.println("Unable to create stress keyspace: " + e.getWhy());
-        }
-        catch (Exception e)
-        {
-            System.err.println("!!!! " + e.getMessage());
-        }
-    }
-
-
     // Option Declarations
 
     private static final class Options extends GroupedOptions

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/settings/SettingsTransport.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsTransport.java b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsTransport.java
index 75b29b3..e1c3c86 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsTransport.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsTransport.java
@@ -29,74 +29,14 @@ import java.util.Map;
 
 import org.apache.cassandra.config.EncryptionOptions;
 import org.apache.cassandra.stress.util.ResultLogger;
-import org.apache.cassandra.thrift.ITransportFactory;
-import org.apache.cassandra.thrift.SSLTransportFactory;
-import org.apache.cassandra.thrift.TFramedTransportFactory;
 
 public class SettingsTransport implements Serializable
 {
-
-    private final String fqFactoryClass;
     private final TOptions options;
-    private ITransportFactory factory;
 
     public SettingsTransport(TOptions options)
     {
         this.options = options;
-        this.fqFactoryClass = options.factory.value();
-        try
-        {
-            Class<?> clazz = Class.forName(fqFactoryClass);
-            if (!ITransportFactory.class.isAssignableFrom(clazz))
-                throw new IllegalArgumentException(clazz + " is not a valid transport factory");
-            // check we can instantiate it
-            clazz.newInstance();
-        }
-        catch (Exception e)
-        {
-            throw new IllegalArgumentException("Invalid transport factory class: " + options.factory.value(), e);
-        }
-    }
-
-    private void configureTransportFactory(ITransportFactory transportFactory, TOptions options)
-    {
-        Map<String, String> factoryOptions = new HashMap<>();
-        // If the supplied factory supports the same set of options as our SSL impl, set those
-        if (transportFactory.supportedOptions().contains(SSLTransportFactory.TRUSTSTORE))
-            factoryOptions.put(SSLTransportFactory.TRUSTSTORE, options.trustStore.value());
-        if (transportFactory.supportedOptions().contains(SSLTransportFactory.TRUSTSTORE_PASSWORD))
-            factoryOptions.put(SSLTransportFactory.TRUSTSTORE_PASSWORD, options.trustStorePw.value());
-        if (transportFactory.supportedOptions().contains(SSLTransportFactory.KEYSTORE))
-            factoryOptions.put(SSLTransportFactory.KEYSTORE, options.keyStore.value());
-        if (transportFactory.supportedOptions().contains(SSLTransportFactory.KEYSTORE_PASSWORD))
-            factoryOptions.put(SSLTransportFactory.KEYSTORE_PASSWORD, options.keyStorePw.value());
-        if (transportFactory.supportedOptions().contains(SSLTransportFactory.PROTOCOL))
-            factoryOptions.put(SSLTransportFactory.PROTOCOL, options.protocol.value());
-        if (transportFactory.supportedOptions().contains(SSLTransportFactory.CIPHER_SUITES))
-            factoryOptions.put(SSLTransportFactory.CIPHER_SUITES, options.ciphers.value());
-        // Now check if any of the factory's supported options are set as system properties
-        for (String optionKey : transportFactory.supportedOptions())
-            if (System.getProperty(optionKey) != null)
-                factoryOptions.put(optionKey, System.getProperty(optionKey));
-
-        transportFactory.setOptions(factoryOptions);
-    }
-
-    public synchronized ITransportFactory getFactory()
-    {
-        if (factory == null)
-        {
-            try
-            {
-                this.factory = (ITransportFactory) Class.forName(fqFactoryClass).newInstance();
-                configureTransportFactory(this.factory, this.options);
-            }
-            catch (Exception e)
-            {
-                throw new RuntimeException(e);
-            }
-        }
-        return factory;
     }
 
     public EncryptionOptions.ClientEncryptionOptions getEncryptionOptions()
@@ -128,20 +68,18 @@ public class SettingsTransport implements Serializable
 
     static class TOptions extends GroupedOptions implements Serializable
     {
-        final OptionSimple factory = new OptionSimple("factory=", ".*", TFramedTransportFactory.class.getName(), "Fully-qualified ITransportFactory class name for creating a connection. Note: For Thrift over SSL, use org.apache.cassandra.thrift.SSLTransportFactory.", false);
         final OptionSimple trustStore = new OptionSimple("truststore=", ".*", null, "SSL: full path to truststore", false);
         final OptionSimple trustStorePw = new OptionSimple("truststore-password=", ".*", null, "SSL: truststore password", false);
         final OptionSimple keyStore = new OptionSimple("keystore=", ".*", null, "SSL: full path to keystore", false);
         final OptionSimple keyStorePw = new OptionSimple("keystore-password=", ".*", null, "SSL: keystore password", false);
         final OptionSimple protocol = new OptionSimple("ssl-protocol=", ".*", "TLS", "SSL: connection protocol to use", false);
         final OptionSimple alg = new OptionSimple("ssl-alg=", ".*", "SunX509", "SSL: algorithm", false);
-        final OptionSimple storeType = new OptionSimple("store-type=", ".*", "JKS", "SSL: keystore format", false);
         final OptionSimple ciphers = new OptionSimple("ssl-ciphers=", ".*", "TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA", "SSL: comma delimited list of encryption suites to use", false);
 
         @Override
         public List<? extends Option> options()
         {
-            return Arrays.asList(factory, trustStore, trustStorePw, keyStore, keyStorePw, protocol, alg, storeType, ciphers);
+            return Arrays.asList(trustStore, trustStorePw, keyStore, keyStorePw, protocol, alg, ciphers);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/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/org/apache/cassandra/stress/settings/StressSettings.java
index 136c8d0..b74e93f 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java
@@ -29,15 +29,7 @@ import com.google.common.collect.ImmutableMap;
 import org.apache.cassandra.config.EncryptionOptions;
 import org.apache.cassandra.stress.util.JavaDriverClient;
 import org.apache.cassandra.stress.util.ResultLogger;
-import org.apache.cassandra.stress.util.SimpleThriftClient;
-import org.apache.cassandra.stress.util.SmartThriftClient;
-import org.apache.cassandra.stress.util.ThriftClient;
-import org.apache.cassandra.thrift.AuthenticationRequest;
-import org.apache.cassandra.thrift.Cassandra;
-import org.apache.cassandra.thrift.InvalidRequestException;
 import org.apache.cassandra.transport.SimpleClient;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.transport.TTransport;
 
 public class StressSettings implements Serializable
 {
@@ -90,81 +82,6 @@ public class StressSettings implements Serializable
         this.tokenRange = tokenRange;
     }
 
-    private SmartThriftClient tclient;
-
-    /**
-     * Thrift client connection
-     * @return cassandra client connection
-     */
-    public synchronized ThriftClient getThriftClient()
-    {
-        if (mode.api != ConnectionAPI.THRIFT_SMART)
-            return getSimpleThriftClient();
-
-        if (tclient == null)
-            tclient = getSmartThriftClient();
-
-        return tclient;
-    }
-
-    private SmartThriftClient getSmartThriftClient()
-    {
-        Metadata metadata = getJavaDriverClient().getCluster().getMetadata();
-        return new SmartThriftClient(this, schema.keyspace, metadata);
-    }
-
-    /**
-     * Thrift client connection
-     * @return cassandra client connection
-     */
-    private SimpleThriftClient getSimpleThriftClient()
-    {
-        return new SimpleThriftClient(getRawThriftClient(node.randomNode(), true));
-    }
-
-    public Cassandra.Client getRawThriftClient(boolean setKeyspace)
-    {
-        return getRawThriftClient(node.randomNode(), setKeyspace);
-    }
-
-    public Cassandra.Client getRawThriftClient(String host)
-    {
-        return getRawThriftClient(host, true);
-    }
-
-    public Cassandra.Client getRawThriftClient(String host, boolean setKeyspace)
-    {
-        Cassandra.Client client;
-
-        try
-        {
-            TTransport transport = this.transport.getFactory().openTransport(host, port.thriftPort);
-
-            client = new Cassandra.Client(new TBinaryProtocol(transport));
-
-            if (mode.cqlVersion.isCql())
-                client.set_cql_version(mode.cqlVersion.connectVersion);
-
-            if (setKeyspace)
-                client.set_keyspace(schema.keyspace);
-
-            if (mode.username != null)
-                client.login(new AuthenticationRequest(ImmutableMap.of("username", mode.username, "password", mode.password)));
-
-        }
-        catch (InvalidRequestException e)
-        {
-            throw new RuntimeException(e.getWhy());
-        }
-        catch (Exception e)
-        {
-            throw new RuntimeException(e);
-        }
-
-        return client;
-    }
-
-
     public SimpleClient getSimpleNativeClient()
     {
         try

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/util/SimpleThriftClient.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/util/SimpleThriftClient.java b/tools/stress/src/org/apache/cassandra/stress/util/SimpleThriftClient.java
deleted file mode 100644
index bb5f4c0..0000000
--- a/tools/stress/src/org/apache/cassandra/stress/util/SimpleThriftClient.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package org.apache.cassandra.stress.util;
-/*
- * 
- * 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.
- * 
- */
-
-
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cassandra.thrift.*;
-import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.thrift.TException;
-
-public class SimpleThriftClient implements ThriftClient
-{
-
-    final Cassandra.Client client;
-    public SimpleThriftClient(Cassandra.Client client)
-    {
-        this.client = client;
-    }
-
-    public void batch_mutate(Map<ByteBuffer, Map<String, List<Mutation>>> record, ConsistencyLevel consistencyLevel) throws TException
-    {
-        client.batch_mutate(record, consistencyLevel);
-    }
-
-    @Override
-    public List<ColumnOrSuperColumn> get_slice(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws TException
-    {
-        return client.get_slice(key, column_parent, predicate, consistency_level);
-    }
-
-    @Override
-    public List<KeySlice> get_indexed_slices(ColumnParent column_parent, IndexClause index_clause, SlicePredicate column_predicate, ConsistencyLevel consistency_level) throws TException
-    {
-        return client.get_indexed_slices(column_parent, index_clause, column_predicate, consistency_level);
-    }
-
-    @Override
-    public List<KeySlice> get_range_slices(ColumnParent column_parent, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level) throws TException
-    {
-        return client.get_range_slices(column_parent, predicate, range, consistency_level);
-    }
-
-    @Override
-    public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice(List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws TException
-    {
-        return client.multiget_slice(keys, column_parent, predicate, consistency_level);
-    }
-
-    @Override
-    public void insert(ByteBuffer key, ColumnParent column_parent, Column column, ConsistencyLevel consistency_level) throws TException
-    {
-        client.insert(key, column_parent, column, consistency_level);
-    }
-
-    @Override
-    public Integer prepare_cql3_query(String query, Compression compression) throws TException
-    {
-        return client.prepare_cql3_query(ByteBufferUtil.bytes(query), compression).itemId;
-    }
-
-    @Override
-    public CqlResult execute_prepared_cql_query(int itemId, ByteBuffer key, List<ByteBuffer> values) throws TException
-    {
-        return client.execute_prepared_cql_query(itemId, values);
-    }
-
-    @Override
-    public Integer prepare_cql_query(String query, Compression compression) throws InvalidRequestException, TException
-    {
-        return client.prepare_cql_query(ByteBufferUtil.bytes(query), compression).itemId;
-    }
-
-    @Override
-    public CqlResult execute_cql3_query(String query, ByteBuffer key, Compression compression, ConsistencyLevel consistency) throws TException
-    {
-        return client.execute_cql3_query(ByteBufferUtil.bytes(query), compression, consistency);
-    }
-
-    @Override
-    public CqlResult execute_prepared_cql3_query(int itemId, ByteBuffer key, List<ByteBuffer> values, ConsistencyLevel consistency) throws TException
-    {
-        return client.execute_prepared_cql3_query(itemId, values, consistency);
-    }
-
-    @Override
-    public CqlResult execute_cql_query(String query, ByteBuffer key, Compression compression) throws TException
-    {
-        return client.execute_cql_query(ByteBufferUtil.bytes(query), compression);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/util/SmartThriftClient.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/util/SmartThriftClient.java b/tools/stress/src/org/apache/cassandra/stress/util/SmartThriftClient.java
deleted file mode 100644
index babbd7a..0000000
--- a/tools/stress/src/org/apache/cassandra/stress/util/SmartThriftClient.java
+++ /dev/null
@@ -1,282 +0,0 @@
-package org.apache.cassandra.stress.util;
-/*
- * 
- * 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.
- * 
- */
-
-
-import java.net.InetAddress;
-import java.nio.ByteBuffer;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.ThreadLocalRandom;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import com.google.common.collect.Iterators;
-
-import com.datastax.driver.core.Host;
-import com.datastax.driver.core.Metadata;
-import org.apache.cassandra.stress.settings.StressSettings;
-import org.apache.cassandra.thrift.*;
-import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.thrift.TException;
-
-public class SmartThriftClient implements ThriftClient
-{
-
-    final String keyspace;
-    final Metadata metadata;
-    final StressSettings settings;
-    final ConcurrentHashMap<InetAddress, ConcurrentLinkedQueue<Client>> cache = new ConcurrentHashMap<>();
-
-    final AtomicInteger queryIdCounter = new AtomicInteger();
-    final ConcurrentHashMap<Integer, String> queryStrings = new ConcurrentHashMap<>();
-    final ConcurrentHashMap<String, Integer> queryIds = new ConcurrentHashMap<>();
-    final Set<InetAddress> whiteset;
-    final List<InetAddress> whitelist;
-
-    public SmartThriftClient(StressSettings settings, String keyspace, Metadata metadata)
-    {
-        this.metadata = metadata;
-        this.keyspace = keyspace;
-        this.settings = settings;
-        if (!settings.node.isWhiteList)
-        {
-            whiteset = null;
-            whitelist = null;
-        }
-        else
-        {
-            whiteset = settings.node.resolveAllSpecified();
-            whitelist = Arrays.asList(whiteset.toArray(new InetAddress[0]));
-        }
-    }
-
-    private final AtomicInteger roundrobin = new AtomicInteger();
-
-    private Integer getId(String query)
-    {
-        Integer r;
-        if ((r = queryIds.get(query)) != null)
-            return r;
-        r = queryIdCounter.incrementAndGet();
-        if (queryIds.putIfAbsent(query, r) == null)
-        {
-            queryStrings.put(r, query);
-            return r;
-        }
-        return queryIds.get(query);
-    }
-
-    final class Client
-    {
-        final Cassandra.Client client;
-        final InetAddress server;
-        final Map<Integer, Integer> queryMap = new HashMap<>();
-
-        Client(Cassandra.Client client, InetAddress server)
-        {
-            this.client = client;
-            this.server = server;
-        }
-
-        Integer get(Integer id, boolean cql3) throws TException
-        {
-            Integer serverId = queryMap.get(id);
-            if (serverId != null)
-                return serverId;
-            prepare(id, cql3);
-            return queryMap.get(id);
-        }
-
-       void prepare(Integer id, boolean cql3) throws TException
-       {
-           String query;
-           while ( null == (query = queryStrings.get(id)) ) ;
-           if (cql3)
-           {
-               Integer serverId = client.prepare_cql3_query(ByteBufferUtil.bytes(query), Compression.NONE).itemId;
-               queryMap.put(id, serverId);
-           }
-           else
-           {
-               Integer serverId = client.prepare_cql_query(ByteBufferUtil.bytes(query), Compression.NONE).itemId;
-               queryMap.put(id, serverId);
-           }
-       }
-    }
-
-    private Client get(ByteBuffer pk)
-    {
-        Set<Host> hosts = metadata.getReplicas(metadata.quote(keyspace), pk);
-        InetAddress address = null;
-        if (hosts.size() > 0)
-        {
-            int pos = roundrobin.incrementAndGet() % hosts.size();
-            for (int i = 0 ; address == null && i < hosts.size() ; i++)
-            {
-                if (pos < 0)
-                    pos = -pos;
-                Host host = Iterators.get(hosts.iterator(), (pos + i) % hosts.size());
-                if (whiteset == null || whiteset.contains(host.getAddress()))
-                    address = host.getAddress();
-            }
-        }
-        if (address == null)
-            address = whitelist.get(ThreadLocalRandom.current().nextInt(whitelist.size()));
-        ConcurrentLinkedQueue<Client> q = cache.get(address);
-        if (q == null)
-        {
-            ConcurrentLinkedQueue<Client> newQ = new ConcurrentLinkedQueue<Client>();
-            q = cache.putIfAbsent(address, newQ);
-            if (q == null)
-                q = newQ;
-        }
-        Client tclient = q.poll();
-        if (tclient != null)
-            return tclient;
-        return new Client(settings.getRawThriftClient(address.getHostAddress()), address);
-    }
-
-    @Override
-    public void batch_mutate(Map<ByteBuffer, Map<String, List<Mutation>>> record, ConsistencyLevel consistencyLevel) throws TException
-    {
-        for (Map.Entry<ByteBuffer, Map<String, List<Mutation>>> e : record.entrySet())
-        {
-            Client client = get(e.getKey());
-            try
-            {
-                client.client.batch_mutate(Collections.singletonMap(e.getKey(), e.getValue()), consistencyLevel);
-            } finally
-            {
-                cache.get(client.server).add(client);
-            }
-        }
-    }
-
-    @Override
-    public List<ColumnOrSuperColumn> get_slice(ByteBuffer key, ColumnParent parent, SlicePredicate predicate, ConsistencyLevel consistencyLevel) throws TException
-    {
-        Client client = get(key);
-        try
-        {
-            return client.client.get_slice(key, parent, predicate, consistencyLevel);
-        } finally
-        {
-            cache.get(client.server).add(client);
-        }
-    }
-
-    @Override
-    public void insert(ByteBuffer key, ColumnParent column_parent, Column column, ConsistencyLevel consistency_level) throws TException
-    {
-        Client client = get(key);
-        try
-        {
-            client.client.insert(key, column_parent, column, consistency_level);
-        } finally
-        {
-            cache.get(client.server).add(client);
-        }
-    }
-
-    @Override
-    public CqlResult execute_cql_query(String query, ByteBuffer key, Compression compression) throws TException
-    {
-        Client client = get(key);
-        try
-        {
-            return client.client.execute_cql_query(ByteBufferUtil.bytes(query), compression);
-        } finally
-        {
-            cache.get(client.server).add(client);
-        }
-    }
-
-    @Override
-    public CqlResult execute_cql3_query(String query, ByteBuffer key, Compression compression, ConsistencyLevel consistency) throws TException
-    {
-        Client client = get(key);
-        try
-        {
-            return client.client.execute_cql3_query(ByteBufferUtil.bytes(query), compression, consistency);
-        } finally
-        {
-            cache.get(client.server).add(client);
-        }
-    }
-
-    @Override
-    public Integer prepare_cql3_query(String query, Compression compression) throws TException
-    {
-        return getId(query);
-    }
-
-    @Override
-    public CqlResult execute_prepared_cql3_query(int queryId, ByteBuffer key, List<ByteBuffer> values, ConsistencyLevel consistency) throws TException
-    {
-        Client client = get(key);
-        try
-        {
-            return client.client.execute_prepared_cql3_query(client.get(queryId, true), values, consistency);
-        } finally
-        {
-            cache.get(client.server).add(client);
-        }
-    }
-
-    @Override
-    public Integer prepare_cql_query(String query, Compression compression) throws TException
-    {
-        return getId(query);
-    }
-
-    @Override
-    public CqlResult execute_prepared_cql_query(int queryId, ByteBuffer key, List<ByteBuffer> values) throws TException
-    {
-        Client client = get(key);
-        try
-        {
-            return client.client.execute_prepared_cql_query(client.get(queryId, true), values);
-        } finally
-        {
-            cache.get(client.server).add(client);
-        }
-    }
-
-    @Override
-    public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice(List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws TException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public List<KeySlice> get_range_slices(ColumnParent column_parent, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level) throws TException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public List<KeySlice> get_indexed_slices(ColumnParent column_parent, IndexClause index_clause, SlicePredicate column_predicate, ConsistencyLevel consistency_level) throws TException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/tools/stress/src/org/apache/cassandra/stress/util/ThriftClient.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/util/ThriftClient.java b/tools/stress/src/org/apache/cassandra/stress/util/ThriftClient.java
deleted file mode 100644
index 3b13758..0000000
--- a/tools/stress/src/org/apache/cassandra/stress/util/ThriftClient.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.apache.cassandra.stress.util;
-/*
- * 
- * 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.
- * 
- */
-
-
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cassandra.thrift.*;
-import org.apache.thrift.TException;
-
-public interface ThriftClient
-{
-
-    public void batch_mutate(Map<ByteBuffer, Map<String, List<Mutation>>> record, ConsistencyLevel consistencyLevel) throws TException;
-
-    List<ColumnOrSuperColumn> get_slice(ByteBuffer key, ColumnParent parent, SlicePredicate predicate, ConsistencyLevel consistencyLevel) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
-
-    void insert(ByteBuffer key, ColumnParent column_parent, Column column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
-
-    Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice(List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
-
-    List<KeySlice> get_range_slices(ColumnParent column_parent, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
-
-    List<KeySlice> get_indexed_slices(ColumnParent column_parent, IndexClause index_clause, SlicePredicate column_predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
-
-    Integer prepare_cql3_query(String query, Compression compression) throws InvalidRequestException, TException;
-
-    CqlResult execute_prepared_cql3_query(int itemId, ByteBuffer key, List<ByteBuffer> values, ConsistencyLevel consistency) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException;
-
-    CqlResult execute_cql_query(String query, ByteBuffer key, Compression compression) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException;
-
-    CqlResult execute_cql3_query(String query, ByteBuffer key, Compression compression, ConsistencyLevel consistency) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException;
-
-    Integer prepare_cql_query(String query, Compression compression) throws InvalidRequestException, TException;
-
-    CqlResult execute_prepared_cql_query(int itemId, ByteBuffer key, List<ByteBuffer> values) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException;
-}


Mime
View raw message