add --skip-keys option to stress.py.  patch by jbellis; reviewed by brandonwilliams for CASSANDRA-1696

git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.6@1030270 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index fe2cde8..4c404c9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -8,6 +8,7 @@
  * Avoid dropping messages off the client request path (CASSANDRA-1676)
  * fix jna errno reporting (CASSANDRA-1694)
  * add friendlier error for UnknownHostException on startup (CASSANDRA-1697)
+ * add --skip-keys option to stress.py (CASSANDRA-1696)
 
 
 0.6.6
diff --git a/contrib/py_stress/stress.py b/contrib/py_stress/stress.py
index 6d758d1..d4d1518 100644
--- a/contrib/py_stress/stress.py
+++ b/contrib/py_stress/stress.py
@@ -61,6 +61,8 @@
 parser = OptionParser()
 parser.add_option('-n', '--num-keys', type="int", dest="numkeys",
                   help="Number of keys", default=1000**2)
+parser.add_option('-N', '--skip-keys', type="float", dest="skipkeys",
+                  help="Fraction of keys to skip initially", default=0)
 parser.add_option('-t', '--threads', type="int", dest="threads",
                   help="Number of threads/procs to use", default=50)
 parser.add_option('-c', '--columns', type="int", dest="columns",
@@ -147,7 +149,8 @@
     def __init__(self, i, counts, latencies):
         Thread.__init__(self)
         # generator of the keys to be used
-        self.range = xrange(keys_per_thread * i, keys_per_thread * (i + 1))
+        self.range = xrange(int(keys_per_thread * (i + options.skipkeys)), 
+                            keys_per_thread * (i + 1))
         # we can't use a local counter, since that won't be visible to the parent
         # under multiprocessing.  instead, the parent passes a "counts" array
         # and an index that is our assigned counter.