O'Reilly logo

Cassandra High Performance Cookbook by Edward Capriolo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using write consistency ONE, read consistency ONE for low latency operations

Consistency level ONE is the lowest latency consistency level available for clients to read and write with. It is low latency because the operation is acknowledgment to the client by only one of the natural endpoints for the data. This recipe shows how to use consistency level ONE, and what the CAP trade-offs are for using this level.

How to do it...

  1. Refer to the getLevel(String) method of <hpc_build>/src/hpcas/c03/Util.java. This will be used to map user-supplied strings to their associated Java enum:
      public static ConsistencyLevel getLevel(String read) {
        return ConsistencyLevel.valueOf(read);
      }
  2. Create <hpc_build>src/hpcas/c05/ConsistencyPerformanceTester.java:
    package hpcas.c03; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required