Book Image

Cassandra High Performance Cookbook

By : Edward Capriolo
Book Image

Cassandra High Performance Cookbook

By: Edward Capriolo

Overview of this book

<p>Apache Cassandra is a fault-tolerant, distributed data store which offers linear scalability allowing it to be a storage platform for large high volume websites. <br /><br />This book provides detailed recipes that describe how to use the features of Cassandra and improve its performance. Recipes cover topics ranging from setting up Cassandra for the first time to complex multiple data center installations. The recipe format presents the information in a concise actionable form.<br /><br />The book describes in detail how features of Cassandra can be tuned and what the possible effects of tuning can be. Recipes include how to access data stored in Cassandra and use third party tools to help you out. The book also describes how to monitor and do capacity planning to ensure it is performing at a high level. Towards the end, it takes you through the use of libraries and third party applications with Cassandra and Cassandra integration with Hadoop.</p>
Table of Contents (20 chapters)
Cassandra High Performance Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using the Cassandra Storage Proxy "Fat Client"


The higher level clients such as Thrift have a more stable API as well as slightly more overhead. These. or even higher level clients such as Hector or Pelops are strongly suggested for most users. Still, a user who requires more access to the Cassandra internals can use the Storage Proxy API directory. The Storage Proxy API is not guaranteed to stay consistent even between minor versions. This recipe shows how to use the Storage Proxy API.

How to do it...

  1. Copy the configuration directory into a sub folder. Then, edit the listen address and RPC address to an unused IP address:

    $ cp -r $home/hpcas/apache-cassandra-0.7.0-beta2-1/conf conf-5node
    vi conf-5node/cassandra.yaml 
    listen_address: 127.0.0.10
    rpc_address: 127.0.0.10
    
  2. Create a file <hpc_build>/src/java/hpcas/c05/StorageServiceExample.java:

    package hpcas.c05;
    
    import java.util.*;
    import org.apache.cassandra.db.*;
    import org.apache.cassandra.db.filter.QueryPath;
    import org.apache.cassandra...