cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r945182 - /cassandra/trunk/contrib/py_stress/stress.py
Date Mon, 17 May 2010 14:35:12 GMT
Author: jbellis
Date: Mon May 17 14:35:11 2010
New Revision: 945182

URL: http://svn.apache.org/viewvc?rev=945182&view=rev
Log:
use get_range_slices in stress.py.  patch by Stu Hood; reviewed by jbellis for CASSANDRA-1094

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=945182&r1=945181&r2=945182&view=diff
==============================================================================
--- cassandra/trunk/contrib/py_stress/stress.py (original)
+++ cassandra/trunk/contrib/py_stress/stress.py Mon May 17 14:35:11 2010
@@ -87,7 +87,7 @@ parser.add_option('-i', '--progress-inte
                   dest="interval", help="progress report interval (seconds)")
 parser.add_option('-g', '--get-range-slice-count', type="int", default=1000,
                   dest="rangecount",
-                  help="amount of keys to get_range_slice per call")
+                  help="amount of keys to get_range_slices per call")
 
 (options, args) = parser.parse_args()
  
@@ -249,14 +249,13 @@ class RangeSlicer(Operation):
         p = SlicePredicate(slice_range=SliceRange('', '', False, columns_per_key))
         if 'super' == options.cftype:
             while current < end:
-                start = fmt % current
-                finish = fmt % last
+                keyrange = KeyRange(fmt % current, fmt % last, count = options.rangecount)
                 res = []
                 for j in xrange(supers_per_key):
                     parent = ColumnParent('Super1', chr(ord('A') + j)) 
                     begin = time.time()
                     try:
-                        res = self.cclient.get_range_slice(parent, p, start,finish, options.rangecount,
ConsistencyLevel.ONE)
+                        res = self.cclient.get_range_slices(parent, p, keyrange, ConsistencyLevel.ONE)
                         if not res: raise RuntimeError("Key %s not found" % key)
                     except KeyboardInterrupt:
                         raise
@@ -275,9 +274,10 @@ class RangeSlicer(Operation):
             while current < end:
                 start = fmt % current 
                 finish = fmt % last
+                keyrange = KeyRange(start, finish, count = options.rangecount)
                 begin = time.time()
                 try:
-                    r = self.cclient.get_range_slice(parent, p, start, finish, options.rangecount,
ConsistencyLevel.ONE)
+                    r = self.cclient.get_range_slices(parent, p, keyrange, ConsistencyLevel.ONE)
                     if not r: raise RuntimeError("Range not found:", start, finish)
                 except KeyboardInterrupt:
                     raise



Mime
View raw message