[ 
https://issues.apache.org/jira/browse/CASSANDRA-859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855665#action_12855665
 ] 

Todd Blose commented on CASSANDRA-859:
--------------------------------------

Morten, not sure what the status is of your work, but I went ahead and worked 
on this to make finishing CASSANDRA-714 easier.

Here is a summary of changes to the cli:

* there is a new command called 'use'.
  use <keyspace> <username> <password> (where username and password are 
optional if it's a keyspace without restrictions)
* the record specifier has been updated to no longer require keyspace in front. 
the ANTLR grammar has been updated.
* instead of seeing "cassandra" at the shell prompt, the text is now 
[u...@keyspace]. if it's a non-privileged keyspace, user is "default". when no 
keyspace has been logged into yet, the actual name is "unknown"

Here is an example session:

Welcome to cassandra CLI.

Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
[defa...@unknown] connect localhost/9160
Connected to: "Test Cluster" on localhost/9160
[defa...@unknown] get test['hi']
Not logged in to a keyspace.
[defa...@unknown] use b
Exception during authentication to the cassandra node, verify you are using 
correct credentials.
[defa...@unknown] use system
Authenticated to keyspace: system
[defa...@system] get test['hi']
column family test key hi
No such column family: test
[defa...@system] help
List of all CLI commands:
?                                                                  Same as help.
help                                                          Display this help.
connect <hostname>/<port>                             Connect to thrift service.
use <keyspace>                                    Switch to a specific keyspace.
use <keyspace> <username> <password>              Switch to privileged keyspace.
describe keyspace <keyspacename>                              Describe keyspace.
exit                                                                   Exit CLI.
quit                                                                   Exit CLI.
show cluster name                                          Display cluster name.
show keyspaces                                           Show list of keyspaces.
show api version                                        Show server API version.
get <cf>['<key>']                                        Get a slice of columns.
get <cf>['<key>']['<super>']                         Get a slice of sub columns.
get <cf>['<key>']['<col>']                                   Get a column value.
get <cf>['<key>']['<super>']['<col>']                    Get a sub column value.
set <cf>['<key>']['<col>'] = '<value>'                             Set a column.
set <cf>['<key>']['<super>']['<col>'] = '<value>'              Set a sub column.
del <cf>['<key>']                                                 Delete record.
del <cf>['<key>']['<col>']                                        Delete column.
del <cf>['<key>']['<super>']['<col>']                         Delete sub column.
count <cf>['<key>']                                     Count columns in record.
count <cf>['<key>']['<super>']                  Count columns in a super column.

obviously, this is a preliminary patch, and feedback is appreciated. I'll be 
testing this more and will add the results to the ticket.

This can be verified separately of CASSANDRA-714 and ultimately merged with it.

> update cassandra-cli for mandatory login()
> ------------------------------------------
>
>                 Key: CASSANDRA-859
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-859
>             Project: Cassandra
>          Issue Type: Task
>          Components: Tools
>    Affects Versions: 0.7
>            Reporter: Eric Evans
>            Priority: Minor
>         Attachments: CASSANDRA-859.patch
>
>
> With the completion of CASSANDRA-714, the cli will need to be updated 
> accordingly.
> * Either the --keyspace command argument (or something equivalent entered 
> interactively after startup), will need to be made required.
> * The record specifier should be changed from `keyspace.column_family['row']' 
> to `column_family['row']'.
> * The keyspace name should be displayed in the prompt, instead of the fixed 
> string "cassandra" as a reminder of the current working keyspace.
> Additionally, a get_string_property("cluster name") was recently added to 
> force connection errors to occur early (the name is also displayed in the 
> banner). Since this changeset will make a login() call mandatory, the 
> get_string_property() call will be unneeded and can be removed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to