mirror of https://github.com/apache/cassandra
remove vestiges of Thrift unframed mode
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-4729
This commit is contained in:
parent
a0d7d9713d
commit
6ca75ef9ba
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue