cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mish...@apache.org
Subject [06/13] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Date Thu, 14 Aug 2014 22:17:44 GMT
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	CHANGES.txt
	bin/cqlsh


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

Branch: refs/heads/cassandra-2.1
Commit: 7a1b6b40f704e06a7475898e8b857cd4587b08ec
Parents: 7a0f496 e756660
Author: Mikhail Stepura <mishail@apache.org>
Authored: Thu Aug 14 15:14:02 2014 -0700
Committer: Mikhail Stepura <mishail@apache.org>
Committed: Thu Aug 14 15:14:02 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 2 ++
 bin/cqlsh   | 5 +++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7a1b6b40/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index e48117a,04902ad..99fb988
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,18 -1,6 +1,20 @@@
 -2.0.10
 +2.1.1
 + * (cqlsh) Error when tracing query (CASSANDRA-7613)
 + * Avoid IOOBE when building SyntaxError message snippet (CASSANDRA-7569)
 + * SSTableExport uses correct validator to create string representation of partition
 +   keys (CASSANDRA-7498)
 + * Avoid NPEs when receiving type changes for an unknown keyspace (CASSANDRA-7689)
 + * Add support for custom 2i validation (CASSANDRA-7575)
 + * Pig support for hadoop CqlInputFormat (CASSANDRA-6454)
 + * Add listen_interface and rpc_interface options (CASSANDRA-7417)
 + * Improve schema merge performance (CASSANDRA-7444)
 + * Adjust MT depth based on # of partition validating (CASSANDRA-5263)
 + * Optimise NativeCell comparisons (CASSANDRA-6755)
 + * Configurable client timeout for cqlsh (CASSANDRA-7516)
 + * Include snippet of CQL query near syntax error in messages (CASSANDRA-7111)
 +Merged from 2.0:
+  * (cqlsh) cqlsh should automatically disable tracing when selecting
+    from system_traces (CASSANDRA-7641)
   * (Hadoop) Add CqlOutputFormat (CASSANDRA-6927)
   * Don't depend on cassandra config for nodetool ring (CASSANDRA-7508)
   * (cqlsh) Fix failing cqlsh formatting tests (CASSANDRA-7703)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7a1b6b40/bin/cqlsh
----------------------------------------------------------------------
diff --cc bin/cqlsh
index 1a2df86,6aa397e..622fd07
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@@ -887,33 -889,53 +887,38 @@@ class Shell(cmd.Cmd)
                  self.current_keyspace = ksname.lower()
  
      def do_select(self, parsed):
 -        ksname = parsed.get_binding('ksname')
 -        if ksname is not None:
 -            ksname = self.cql_unprotect_name(ksname)
 -        cfname = self.cql_unprotect_name(parsed.get_binding('cfname'))
+         tracing_was_enabled = self.tracing_enabled
++        ksname = parsed.get_binding('ksname')
+         stop_tracing = ksname == 'system_traces' or (ksname is None and self.current_keyspace
== 'system_traces')
+         self.tracing_enabled = self.tracing_enabled and not stop_tracing
          statement = parsed.extract_orig()
          with_default_limit = parsed.get_binding('limit') is None
          if with_default_limit:
              statement = "%s LIMIT %d;" % (statement[:-1], DEFAULT_SELECT_LIMIT)
 -        self.perform_statement(statement,
 -                               decoder=ErrorHandlingSchemaDecoder,
 -                               with_default_limit=with_default_limit)
 +        self.perform_statement(statement, with_default_limit=with_default_limit)
+         self.tracing_enabled = tracing_was_enabled
  
 -    def perform_statement(self, statement, decoder=None, with_default_limit=False):
 +    def perform_statement(self, statement, with_default_limit=False):
 +        stmt = SimpleStatement(statement, consistency_level=self.consistency_level)
 +        result = self.perform_simple_statement(stmt,
 +                                                with_default_limit=with_default_limit)
          if self.tracing_enabled:
 -            session_id = UUID(bytes=self.trace_next_query())
 -            result = self.perform_statement_untraced(statement,
 -                                                     decoder=decoder,
 -                                                     with_default_limit=with_default_limit)
 -            time.sleep(0.5) # trace writes are async so we wait a little.
 -            print_trace_session(self, self.cursor, session_id)
 -            return result
 -        else:
 -            return self.perform_statement_untraced(statement,
 -                                                   decoder=decoder,
 -                                                   with_default_limit=with_default_limit)
 +            if stmt.trace:
 +                print_trace(self, stmt.trace)
 +            else:
 +                msg = "Statement trace did not complete within %d seconds" % (self.session.max_trace_wait)
 +                self.writeresult(msg, color=RED)
  
 -    def perform_statement_untraced(self, statement, decoder=None, with_default_limit=False):
 +        return result
 +
 +    def perform_simple_statement(self, statement, with_default_limit=False):
          if not statement:
              return False
 -        trynum = 1
 +        rows = None
          while True:
              try:
 -                self.cursor.execute(statement, decoder=decoder)
 +                rows = self.session.execute(statement, trace=self.tracing_enabled)
                  break
 -            except cql.IntegrityError, err:
 -                self.printerr("Attempt #%d: %s" % (trynum, str(err)))
 -                trynum += 1
 -                if trynum > self.num_retries:
 -                    return False
 -                time.sleep(1*trynum)
 -            except cql.ProgrammingError, err:
 -                self.printerr(str(err))
 -                return False
              except CQL_ERRORS, err:
                  self.printerr(str(err))
                  return False


Mime
View raw message