You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2010/07/15 21:52:27 UTC

svn commit: r964554 - /cassandra/trunk/contrib/py_stress/stress.py

Author: brandonwilliams
Date: Thu Jul 15 19:52:26 2010
New Revision: 964554

URL: http://svn.apache.org/viewvc?rev=964554&view=rev
Log:
stress.py uses framed mode by default

Modified:
    cassandra/trunk/contrib/py_stress/stress.py

Modified: cassandra/trunk/contrib/py_stress/stress.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/py_stress/stress.py?rev=964554&r1=964553&r2=964554&view=diff
==============================================================================
--- cassandra/trunk/contrib/py_stress/stress.py (original)
+++ cassandra/trunk/contrib/py_stress/stress.py Thu Jul 15 19:52:26 2010
@@ -75,8 +75,8 @@ parser.add_option('-f', '--file', type="
                   help="write output to file")
 parser.add_option('-p', '--port', type="int", default=9160, dest="port",
                   help="thrift port")
-parser.add_option('-m', '--unframed', action="store_false", dest="framed",
-                  help="use framed transport")
+parser.add_option('-m', '--unframed', action="store_true", dest="unframed",
+                  help="use unframed transport")
 parser.add_option('-o', '--operation', type="choice", dest="operation",
                   default="insert", choices=('insert', 'read', 'rangeslice'),
                   help="operation to perform")
@@ -139,12 +139,12 @@ if options.random:
     key_generator = key_generator_random
 
 
-def get_client(host='127.0.0.1', port=9160, framed=True):
+def get_client(host='127.0.0.1', port=9160):
     socket = TSocket.TSocket(host, port)
-    if framed:
-        transport = TTransport.TFramedTransport(socket)
-    else:
+    if options.unframed:
         transport = TTransport.TBufferedTransport(socket)
+    else:
+        transport = TTransport.TFramedTransport(socket)
     protocol = TBinaryProtocol.TBinaryProtocolAccelerated(transport)
     client = Cassandra.Client(protocol)
     client.transport = transport
@@ -154,7 +154,7 @@ def make_keyspaces():
     cfams = [CfDef('Keyspace1', 'Standard1'),
              CfDef('Keyspace1', 'Super1', 'Super')]
     keyspace = KsDef('Keyspace1', 'org.apache.cassandra.locator.RackUnawareStrategy', options.replication, cfams)
-    client = get_client(nodes[0], options.port, options.framed)
+    client = get_client(nodes[0], options.port)
     client.transport.open()
     try:
         client.system_add_keyspace(keyspace)
@@ -180,7 +180,7 @@ class Operation(Thread):
         # random host for pseudo-load-balancing
         [hostname] = random.sample(nodes, 1)
         # open client
-        self.cclient = get_client(hostname, options.port, options.framed)
+        self.cclient = get_client(hostname, options.port)
         self.cclient.transport.open()
         self.cclient.set_keyspace('Keyspace1')