code: public static void main(String args[]) throws Exception
      {
          startClient();
          setupKeyspace();
          testWriting();
          logger.info("Writing is done. Sleeping, then will try to read.");
          Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);
  
          testReading();
  
          // no need to do this:
          // StorageService.instance().decommission();
          // do this instead:
          StorageService.instance.stopClient();
          System.exit(0); // the only way to really stop the process.
      }
docs: First, bring one or more nodes up. Then run ClientOnlyExample with these VM arguments:
  <p/>
  -Xmx1G
  -Dcassandra.config=/Users/gary/cassandra/conf/cassandra.yaml (optional, will first look for cassandra.yaml on classpath)
  <p/>
  Pass "write" or "read" into the program to exercise the various methods.
  <p/>
  Caveats:
  <p/>
  1.  Much of cassandra is not reentrant.  That is, you can't spin a client up, down, then back up in the same jvm.
  2.  Because of the above, you still need to force-quit the process. StorageService.stopClient() doesn't (can't)
  spin everything down.