Tuesday, February 5, 2013

A Smart and Quick Cassandra Client

Recently I wanted to get the internal details of a created Column Family. Here how I did that. 
  • Download the latest Cassandra server from here.
  • Extract to a preferred location. This will be known as CASS_HOME
  • Start up the Cassandra Server. For my task, I was using the built-in cassandra support that comes with WSO2 CEP. (The Cassandra server was running in localhost:9161)
  • Navigate to CASS_HOME/bin. From there execute the command below.
 sh cassandra-cli -h localhost -p 9161 -u admin -pw admin
  • The above command will take you to the Cassandra CLI console. Type the command below to get the key spaces:
show keyspaces;
  • That would show up fine details like validation class and comparator type etc. as follows:
Keyspace: LocationKeySpaceTestDemo_25:
  Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
  Durable Writes: true
    Options: [replication_factor:1]
  Column Families:
    ColumnFamily: LocationDataTestDemo_25
      Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
      Default column value validator: org.apache.cassandra.db.marshal.UTF8Type
      Columns sorted by: org.apache.cassandra.db.marshal.UTF8Type
      GC grace seconds: 0
      Compaction min/max thresholds: 4/32
      Read repair chance: 0.0
      DC Local Read repair chance: 0.0
      Replicate on write: false
      Caching: KEYS_ONLY
      Bloom Filter FP chance: default
      Column Metadata:
        Column Name: lon
          Validation Class: org.apache.cassandra.db.marshal.UTF8Type
        Column Name: lat
          Validation Class: org.apache.cassandra.db.marshal.UTF8Type
        Column Name: timestamp
          Validation Class: org.apache.cassandra.db.marshal.UTF8Type
      Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
      Compression Options:
        sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor
WARNING: Could not connect to the JMX on localhost:7199, information won't be shown.

No comments:

Post a Comment