You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by bl...@apache.org on 2016/01/13 14:53:32 UTC

[1/5] cassandra git commit: (cqlsh) Add request timeout option to cqlsh

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.3 0693db7b8 -> cf3dcc2bb


(cqlsh) Add request timeout option to cqlsh

patch by Paulo Motta; reviewed by Benjamin Lerer for CASSANDRA-10686


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c0747d28
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c0747d28
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c0747d28

Branch: refs/heads/cassandra-3.3
Commit: c0747d2856b69fb1e85addf090a9e135637798c4
Parents: df342b9
Author: Paulo Motta <pa...@gmail.com>
Authored: Wed Jan 13 14:31:28 2016 +0100
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Wed Jan 13 14:31:28 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt |  1 +
 bin/cqlsh   | 22 +++++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0747d28/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 7ec4cb9..552aca2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.13
+ * (cqlsh) Add request timeout option to cqlsh (CASSANDRA-10686)
  * Avoid AssertionError while submitting hint with LWT (CASSANDRA-10477)
  * If CompactionMetadata is not in stats file, use index summary instead (CASSANDRA-10676)
  * Retry sending gossip syn multiple times during shadow round (CASSANDRA-8072)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0747d28/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index e2bfcd7..7a39636 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -132,6 +132,7 @@ DEFAULT_PORT = 9042
 DEFAULT_CQLVER = '3.2.1'
 DEFAULT_PROTOCOL_VERSION = 3
 DEFAULT_CONNECT_TIMEOUT_SECONDS = 5
+DEFAULT_REQUEST_TIMEOUT_SECONDS = 10
 
 DEFAULT_TIME_FORMAT = '%Y-%m-%d %H:%M:%S%z'
 DEFAULT_FLOAT_PRECISION = 5
@@ -174,6 +175,8 @@ parser.add_option('--cqlversion', default=DEFAULT_CQLVER,
 parser.add_option("-e", "--execute", help='Execute the statement and quit.')
 parser.add_option("--connect-timeout", default=DEFAULT_CONNECT_TIMEOUT_SECONDS, dest='connect_timeout',
                   help='Specify the connection timeout in seconds (default: %default seconds).')
+parser.add_option("--request-timeout", default=DEFAULT_REQUEST_TIMEOUT_SECONDS, dest='request_timeout',
+                  help='Specify the default request timeout in seconds (default: %default seconds).')
 
 optvalues = optparse.Values()
 (options, arguments) = parser.parse_args(sys.argv[1:], values=optvalues)
@@ -602,7 +605,7 @@ class Shell(cmd.Cmd):
                  max_trace_wait=DEFAULT_MAX_TRACE_WAIT,
                  ssl=False,
                  single_statement=None,
-                 client_timeout=10,
+                 request_timeout=DEFAULT_REQUEST_TIMEOUT_SECONDS,
                  connect_timeout=DEFAULT_CONNECT_TIMEOUT_SECONDS):
         cmd.Cmd.__init__(self, completekey=completekey)
         self.hostname = hostname
@@ -642,7 +645,7 @@ class Shell(cmd.Cmd):
         if not self.conn.metadata.keyspaces:
             self.refresh_schema_metadata_best_effort()
 
-        self.session.default_timeout = client_timeout
+        self.session.default_timeout = request_timeout
         self.session.row_factory = ordered_dict_factory
         self.get_connection_versions()
 
@@ -2045,6 +2048,7 @@ def read_options(cmdlineargs, environment):
     optvalues.tty = sys.stdin.isatty()
     optvalues.cqlversion = option_with_default(configs.get, 'cql', 'version', DEFAULT_CQLVER)
     optvalues.connect_timeout = option_with_default(configs.getint, 'connection', 'timeout', DEFAULT_CONNECT_TIMEOUT_SECONDS)
+    optvalues.request_timeout = option_with_default(configs.getint, 'connection', 'request_timeout', DEFAULT_CONNECT_TIMEOUT_SECONDS)
     optvalues.execute = None
 
     (options, arguments) = parser.parse_args(cmdlineargs, values=optvalues)
@@ -2055,14 +2059,14 @@ def read_options(cmdlineargs, environment):
     try:
         options.connect_timeout = int(options.connect_timeout)
     except ValueError:
-        parser.error('"%s" is not a valid timeout.' % (options.connect_timeout,))
+        parser.error('"%s" is not a valid connect timeout.' % (options.connect_timeout,))
         options.connect_timeout = DEFAULT_CONNECT_TIMEOUT_SECONDS
 
-    options.client_timeout = option_with_default(configs.get, 'connection', 'client_timeout', '10')
-    if options.client_timeout.lower() == 'none':
-        options.client_timeout = None
-    else:
-        options.client_timeout = int(options.client_timeout)
+    try:
+        options.request_timeout = int(options.request_timeout)
+    except ValueError:
+        parser.error('"%s" is not a valid request timeout.' % (options.request_timeout,))
+        options.request_timeout = DEFAULT_REQUEST_TIMEOUT_SECONDS
 
     hostname = environment.get('CQLSH_HOST', hostname)
     port = environment.get('CQLSH_PORT', port)
@@ -2170,7 +2174,7 @@ def main(options, hostname, port):
                       max_trace_wait=options.max_trace_wait,
                       ssl=options.ssl,
                       single_statement=options.execute,
-                      client_timeout=options.client_timeout,
+                      request_timeout=options.request_timeout,
                       connect_timeout=options.connect_timeout,
                       encoding=options.encoding)
     except KeyboardInterrupt:


[5/5] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.3

Posted by bl...@apache.org.
Merge branch cassandra-3.0 into cassandra-3.3


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cf3dcc2b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cf3dcc2b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cf3dcc2b

Branch: refs/heads/cassandra-3.3
Commit: cf3dcc2bb267fefc591e9167c02168cdc65bb500
Parents: 0693db7 95012da
Author: Benjamin Lerer <b....@gmail.com>
Authored: Wed Jan 13 14:53:03 2016 +0100
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Wed Jan 13 14:53:03 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt  |  1 +
 bin/cqlsh.py | 22 +++++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf3dcc2b/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index dfa073b,38786c1..fd05c01
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -7,27 -4,6 +7,28 @@@ Merged from 3.0
     tombstone (CASSANDRA-10743)
   * MV should use the maximum timestamp of the primary key (CASSANDRA-10910)
   * Fix potential assertion error during compaction (CASSANDRA-10944)
 +Merged from 2.2:
 + * Histogram buckets exposed in jmx are sorted incorrectly (CASSANDRA-10975)
 + * Enable GC logging by default (CASSANDRA-10140)
 + * Optimize pending range computation (CASSANDRA-9258)
 + * Skip commit log and saved cache directories in SSTable version startup check (CASSANDRA-10902)
 + * drop/alter user should be case sensitive (CASSANDRA-10817)
 +Merged from 2.1:
++ * (cqlsh) Add request timeout option to cqlsh (CASSANDRA-10686)
 + * Avoid AssertionError while submitting hint with LWT (CASSANDRA-10477)
 + * If CompactionMetadata is not in stats file, use index summary instead (CASSANDRA-10676)
 + * Retry sending gossip syn multiple times during shadow round (CASSANDRA-8072)
 + * Fix pending range calculation during moves (CASSANDRA-10887)
 + * Sane default (200Mbps) for inter-DC streaming througput (CASSANDRA-8708)
 +
 +
 +3.2
 + * Make sure tokens don't exist in several data directories (CASSANDRA-6696)
 + * Add requireAuthorization method to IAuthorizer (CASSANDRA-10852)
 + * Move static JVM options to conf/jvm.options file (CASSANDRA-10494)
 + * Fix CassandraVersion to accept x.y version string (CASSANDRA-10931)
 + * Add forceUserDefinedCleanup to allow more flexible cleanup (CASSANDRA-10708)
 + * (cqlsh) allow setting TTL with COPY (CASSANDRA-9494)
   * Fix counting of received sstables in streaming (CASSANDRA-10949)
   * Implement hints compression (CASSANDRA-9428)
   * Fix potential assertion error when reading static columns (CASSANDRA-10903)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf3dcc2b/bin/cqlsh.py
----------------------------------------------------------------------


[2/5] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2

Posted by bl...@apache.org.
Merge branch cassandra-2.1 into cassandra-2.2


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/7550ebd9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7550ebd9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7550ebd9

Branch: refs/heads/cassandra-3.3
Commit: 7550ebd9cca222de964ba190af3628cd3d0da1cb
Parents: f13a7df c0747d2
Author: Benjamin Lerer <b....@gmail.com>
Authored: Wed Jan 13 14:39:49 2016 +0100
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Wed Jan 13 14:41:40 2016 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------



[4/5] cassandra git commit: Merge branch cassandra-2.2 into cassandra-3.0

Posted by bl...@apache.org.
Merge branch cassandra-2.2 into cassandra-3.0


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/95012dab
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/95012dab
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/95012dab

Branch: refs/heads/cassandra-3.3
Commit: 95012dab5b9a6f70a419fb0a6f34bf665de1a285
Parents: 9803d66 c7f0032
Author: Benjamin Lerer <b....@gmail.com>
Authored: Wed Jan 13 14:49:26 2016 +0100
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Wed Jan 13 14:49:41 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt  |  1 +
 bin/cqlsh.py | 22 +++++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/95012dab/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/95012dab/bin/cqlsh.py
----------------------------------------------------------------------
diff --cc bin/cqlsh.py
index 60ac1a2,c03a3c2..987aa59
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@@ -163,9 -162,10 +163,10 @@@ from cqlshlib.util import get_file_enco
  
  DEFAULT_HOST = '127.0.0.1'
  DEFAULT_PORT = 9042
 -DEFAULT_CQLVER = '3.3.1'
 +DEFAULT_CQLVER = '3.4.0'
  DEFAULT_PROTOCOL_VERSION = 4
  DEFAULT_CONNECT_TIMEOUT_SECONDS = 5
+ DEFAULT_REQUEST_TIMEOUT_SECONDS = 10
  
  DEFAULT_FLOAT_PRECISION = 5
  DEFAULT_MAX_TRACE_WAIT = 10


[3/5] cassandra git commit: (cqlsh) Add request timeout option to cqlsh

Posted by bl...@apache.org.
(cqlsh) Add request timeout option to cqlsh

patch by Paulo Motta; reviewed by Benjamin Lerer for CASSANDRA-10686


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c7f00329
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c7f00329
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c7f00329

Branch: refs/heads/cassandra-3.3
Commit: c7f0032912798b5e53b64d8391e3e3d7e4121165
Parents: 7550ebd
Author: Paulo Motta <pa...@gmail.com>
Authored: Wed Jan 13 14:48:04 2016 +0100
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Wed Jan 13 14:48:04 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt  |  1 +
 bin/cqlsh.py | 22 +++++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7f00329/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 21c5b27..1554cf5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,6 +16,7 @@
  * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474)
  * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761)
 Merged from 2.1:
+ * (cqlsh) Add request timeout option to cqlsh (CASSANDRA-10686)
  * Avoid AssertionError while submitting hint with LWT (CASSANDRA-10477)
  * If CompactionMetadata is not in stats file, use index summary instead (CASSANDRA-10676)
  * Retry sending gossip syn multiple times during shadow round (CASSANDRA-8072)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7f00329/bin/cqlsh.py
----------------------------------------------------------------------
diff --git a/bin/cqlsh.py b/bin/cqlsh.py
index be2ad46..c03a3c2 100644
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@ -165,6 +165,7 @@ DEFAULT_PORT = 9042
 DEFAULT_CQLVER = '3.3.1'
 DEFAULT_PROTOCOL_VERSION = 4
 DEFAULT_CONNECT_TIMEOUT_SECONDS = 5
+DEFAULT_REQUEST_TIMEOUT_SECONDS = 10
 
 DEFAULT_FLOAT_PRECISION = 5
 DEFAULT_MAX_TRACE_WAIT = 10
@@ -209,6 +210,8 @@ parser.add_option('--cqlversion', default=DEFAULT_CQLVER,
 parser.add_option("-e", "--execute", help='Execute the statement and quit.')
 parser.add_option("--connect-timeout", default=DEFAULT_CONNECT_TIMEOUT_SECONDS, dest='connect_timeout',
                   help='Specify the connection timeout in seconds (default: %default seconds).')
+parser.add_option("--request-timeout", default=DEFAULT_REQUEST_TIMEOUT_SECONDS, dest='request_timeout',
+                  help='Specify the default request timeout in seconds (default: %default seconds).')
 parser.add_option("-t", "--tty", action='store_true', dest='tty',
                   help='Force tty mode (command prompt).')
 
@@ -657,7 +660,7 @@ class Shell(cmd.Cmd):
                  max_trace_wait=DEFAULT_MAX_TRACE_WAIT,
                  ssl=False,
                  single_statement=None,
-                 client_timeout=10,
+                 request_timeout=DEFAULT_REQUEST_TIMEOUT_SECONDS,
                  protocol_version=DEFAULT_PROTOCOL_VERSION,
                  connect_timeout=DEFAULT_CONNECT_TIMEOUT_SECONDS):
         cmd.Cmd.__init__(self, completekey=completekey)
@@ -707,7 +710,7 @@ class Shell(cmd.Cmd):
         if not self.conn.metadata.keyspaces:
             self.refresh_schema_metadata_best_effort()
 
-        self.session.default_timeout = client_timeout
+        self.session.default_timeout = request_timeout
         self.session.row_factory = ordered_dict_factory
         self.session.default_consistency_level = cassandra.ConsistencyLevel.ONE
         self.get_connection_versions()
@@ -2324,6 +2327,7 @@ def read_options(cmdlineargs, environment):
     optvalues.tty = option_with_default(configs.getboolean, 'ui', 'tty', sys.stdin.isatty())
     optvalues.cqlversion = option_with_default(configs.get, 'cql', 'version', DEFAULT_CQLVER)
     optvalues.connect_timeout = option_with_default(configs.getint, 'connection', 'timeout', DEFAULT_CONNECT_TIMEOUT_SECONDS)
+    optvalues.request_timeout = option_with_default(configs.getint, 'connection', 'request_timeout', DEFAULT_REQUEST_TIMEOUT_SECONDS)
     optvalues.execute = None
 
     (options, arguments) = parser.parse_args(cmdlineargs, values=optvalues)
@@ -2334,14 +2338,14 @@ def read_options(cmdlineargs, environment):
     try:
         options.connect_timeout = int(options.connect_timeout)
     except ValueError:
-        parser.error('"%s" is not a valid timeout.' % (options.connect_timeout,))
+        parser.error('"%s" is not a valid connect timeout.' % (options.connect_timeout,))
         options.connect_timeout = DEFAULT_CONNECT_TIMEOUT_SECONDS
 
-    options.client_timeout = option_with_default(configs.get, 'connection', 'client_timeout', '10')
-    if options.client_timeout.lower() == 'none':
-        options.client_timeout = None
-    else:
-        options.client_timeout = int(options.client_timeout)
+    try:
+        options.request_timeout = int(options.request_timeout)
+    except ValueError:
+        parser.error('"%s" is not a valid request timeout.' % (options.request_timeout,))
+        options.request_timeout = DEFAULT_REQUEST_TIMEOUT_SECONDS
 
     hostname = environment.get('CQLSH_HOST', hostname)
     port = environment.get('CQLSH_PORT', port)
@@ -2451,7 +2455,7 @@ def main(options, hostname, port):
                       max_trace_wait=options.max_trace_wait,
                       ssl=options.ssl,
                       single_statement=options.execute,
-                      client_timeout=options.client_timeout,
+                      request_timeout=options.request_timeout,
                       connect_timeout=options.connect_timeout,
                       encoding=options.encoding)
     except KeyboardInterrupt: