cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [2/3] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Date Fri, 15 May 2015 16:45:11 GMT
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.2
Commit: 9f8c45d6d6b8581bde536475d366b7783f9a7767
Parents: 7d6a60d 0b92967
Author: Tyler Hobbs <tylerlhobbs@gmail.com>
Authored: Fri May 15 11:41:25 2015 -0500
Committer: Tyler Hobbs <tylerlhobbs@gmail.com>
Committed: Fri May 15 11:41:25 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt |  1 +
 bin/cqlsh   | 42 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9f8c45d6/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 129f6a1,a9d04d6..c85d031
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,30 -1,5 +1,31 @@@
 -2.0.16:
 +2.1.6
 + * Warn on misuse of unlogged batches (CASSANDRA-9282)
 + * Failure detector detects and ignores local pauses (CASSANDRA-9183)
 + * Add utility class to support for rate limiting a given log statement (CASSANDRA-9029)
 + * Add missing consistency levels to cassandra-stess (CASSANDRA-9361)
 + * Fix commitlog getCompletedTasks to not increment (CASSANDRA-9339)
 + * Fix for harmless exceptions logged as ERROR (CASSANDRA-8564)
 + * Delete processed sstables in sstablesplit/sstableupgrade (CASSANDRA-8606)
 + * Improve sstable exclusion from partition tombstones (CASSANDRA-9298)
 + * Validate the indexed column rather than the cell's contents for 2i (CASSANDRA-9057)
 + * Add support for top-k custom 2i queries (CASSANDRA-8717)
 + * Fix error when dropping table during compaction (CASSANDRA-9251)
 + * cassandra-stress supports validation operations over user profiles (CASSANDRA-8773)
 + * Add support for rate limiting log messages (CASSANDRA-9029)
 + * Log the partition key with tombstone warnings (CASSANDRA-8561)
 + * Reduce runWithCompactionsDisabled poll interval to 1ms (CASSANDRA-9271)
 + * Fix PITR commitlog replay (CASSANDRA-9195)
 + * GCInspector logs very different times (CASSANDRA-9124)
 + * Fix deleting from an empty list (CASSANDRA-9198)
 + * Update tuple and collection types that use a user-defined type when that UDT
 +   is modified (CASSANDRA-9148, CASSANDRA-9192)
 + * Use higher timeout for prepair and snapshot in repair (CASSANDRA-9261)
 + * Fix anticompaction blocking ANTI_ENTROPY stage (CASSANDRA-9151)
 + * Repair waits for anticompaction to finish (CASSANDRA-9097)
 + * Fix streaming not holding ref when stream error (CASSANDRA-9295)
 + * Fix canonical view returning early opened SSTables (CASSANDRA-9396)
 +Merged from 2.0:
+  * (cqlsh) Add LOGIN command to switch users (CASSANDRA-7212)
   * Clone SliceQueryFilter in AbstractReadCommand implementations (CASSANDRA-8940)
   * Push correct protocol notification for DROP INDEX (CASSANDRA-9310)
   * token-generator - generated tokens too long (CASSANDRA-9300)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9f8c45d6/bin/cqlsh
----------------------------------------------------------------------
diff --cc bin/cqlsh
index 9a6504a,fa0de7f..a4cc5d4
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@@ -331,9 -292,9 +333,12 @@@ cqlsh_extra_syntax_rules = r''
  <expandCommand> ::= "EXPAND" ( switch=( "ON" | "OFF" ) )?
                     ;
  
 +<pagingCommand> ::= "PAGING" ( switch=( "ON" | "OFF" ) )?
 +                  ;
 +
+ <loginCommand> ::= "LOGIN" username=<username> (password=<stringLiteral>)?
+                  ;
+ 
  <exitCommand> ::= "exit" | "quit"
                  ;
  
@@@ -1941,38 -1824,41 +1946,75 @@@ class Shell(cmd.Cmd)
          """
          level = parsed.get_binding('level')
          if level is None:
 -            print 'Current consistency level is %s.' % (self.cursor.consistency_level,)
 +            print 'Current consistency level is %s.' % (cassandra.ConsistencyLevel.value_to_name[self.consistency_level])
              return
  
 -        self.cursor.consistency_level = level.upper()
 +        self.consistency_level = cassandra.ConsistencyLevel.name_to_value[level.upper()]
          print 'Consistency level set to %s.' % (level.upper(),)
  
 +    def do_serial(self, parsed):
 +        """
 +        SERIAL CONSISTENCY [cqlsh only]
 +
 +           Overrides serial consistency level (default level is SERIAL).
 +
 +        SERIAL CONSISTENCY <level>
 +
 +           Sets consistency level for future conditional updates.
 +
 +           Valid consistency levels:
 +
 +           SERIAL, LOCAL_SERIAL.
 +
 +        SERIAL CONSISTENCY
 +
 +           SERIAL CONSISTENCY with no arguments shows the current consistency level.
 +        """
 +        level = parsed.get_binding('level')
 +        if level is None:
 +            print 'Current serial consistency level is %s.' % (cassandra.ConsistencyLevel.value_to_name[self.serial_consistency_level])
 +            return
 +
 +        self.serial_consistency_level = cassandra.ConsistencyLevel.name_to_value[level.upper()]
 +        print 'Serial consistency level set to %s.' % (level.upper(),)
 +
+     def do_login(self, parsed):
+         """
+         LOGIN [cqlsh only]
+ 
+            Changes login information without requiring restart.
+ 
+         LOGIN <username> (<password>)
+ 
+            Login using the specified username. If password is specified, it will be used
+            otherwise, you will be prompted to enter.
+         """
+         username = parsed.get_binding('username')
+         password = parsed.get_binding('password')
+         if password is None:
+             password = getpass.getpass()
+         else:
+             password = password[1:-1]
+ 
 -        transport = self.transport_factory(self.hostname, self.port, os.environ, CONFIG_FILE)
 -        conn = cql.connect(self.hostname, self.port, keyspace=self.current_keyspace, user=username,
 -                                password=password, cql_version=self.conn.cql_version,
 -                                transport=transport)
++        auth_provider = PlainTextAuthProvider(username=username, password=password)
++
++        conn = Cluster(contact_points=(self.hostname,), port=self.port, cql_version=self.conn.cql_version,
++                       protocol_version=DEFAULT_PROTOCOL_VERSION,
++                       auth_provider=auth_provider,
++                       ssl_options=self.conn.ssl_options,
++                       load_balancing_policy=WhiteListRoundRobinPolicy([self.hostname]))
+ 
++        if self.current_keyspace:
++            session = conn.connect(self.current_keyspace)
++        else:
++            session = conn.connect()
++
++        # Update after we've connected in case we fail to authenticate
++        self.conn = conn
++        self.auth_provider = auth_provider
+         self.username = username
 -        self.password = password
 -        self.conn=conn
 -        self.cursor = self.conn.cursor()
 -        self.get_connection_versions()
++        self.session = session
+ 
      def do_exit(self, parsed=None):
          """
          EXIT/QUIT [cqlsh only]


Mime
View raw message