cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Cassandra Wiki] Update of "CassandraCli" by SandeepTata
Date Tue, 12 May 2009 20:42:19 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.

The following page has been changed by SandeepTata:

The comment on the change is:
CLI tutorial from README

New page:
The CLI is a simple java program that lets you connect to a Cassandra server and interactively
store and retrieve data.
After starting the Cassandra server, launch the CLI using:

  * `bin/cassandra-cli --host localhost --port 9160`

You should see:
  Connected to localhost/9160
  Welcome to cassandra CLI.
  Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.

As the banner says, you can use 'help' or '?' to see what the CLI has to
offer, and 'quit' or 'exit' when you've had enough fun. But lets try
something slightly more interesting...

  cassandra> set Table1.Standard1['jsmith']['first'] = 'John'
  Statement processed.
  cassandra> set Table1.Standard1['jsmith']['last'] = 'Smith' 
  Statement processed.
  cassandra> set Table1.Standard1['jsmith']['age'] = '42'
  Statement processed.

We just added a key `jsmith` and three columns (`first`, `last`, and `age`) to the `Standard1`
column family. (Check out [DataModel] for a primer on the Table abstraction provided by Cassandra
if these terms don't make sense just yet.)

Now we read back the `jsmith` row to see what it contains:

  cassandra> get Table1.Standard1['jsmith']
  COLUMN_TIMESTAMP = 1241129773658; COLUMN_VALUE = 42; COLUMN_KEY = age;
  COLUMN_TIMESTAMP = 1241129537336; COLUMN_VALUE = Smith; COLUMN_KEY = last; 
  COLUMN_TIMESTAMP = 1241129520503; COLUMN_VALUE = John; COLUMN_KEY = first; 
  Statement processed.

View raw message