Examples of CassandraClientPool


Examples of org.yosemite.jcsadra.CassandraClientPool

  }

  private static void runCassandraClient() throws NoSuchElementException,
      IllegalStateException, Exception {

    CassandraClientPool pool = getClientPool();

    CassandraClient cl = pool.getClient();
    KeySpace ks = cl.getKeySpace(KEYSPACE);

    // Insert values
    insertValue(ks, "Linguagem", "java", "1");
    insertValue(ks, "Linguagem", "ruby", "2");
    insertValue(ks, "Linguagem", "python", "3");

    // Get values
    System.out.println(getValue(ks, "Linguagem", "java"));
    System.out.println(getValue(ks, "Linguagem", "ruby"));
    System.out.println(getValue(ks, "Linguagem", "python"));

    // Remove values
    removeValue(ks, "Linguagem", "java");
    removeValue(ks, "Linguagem", "ruby");
    removeValue(ks, "Linguagem", "python");

    pool.releaseClient(cl);
    pool.close();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.