Example usage for org.apache.cassandra.db ConsistencyLevel ALL

List of usage examples for org.apache.cassandra.db ConsistencyLevel ALL

Introduction

In this page you can find the example usage for org.apache.cassandra.db ConsistencyLevel ALL.

Prototype

ConsistencyLevel ALL

To view the source code for org.apache.cassandra.db ConsistencyLevel ALL.

Click Source Link

Usage

From source file:org.elassandra.cluster.InternalCassandraClusterService.java

License:Apache License

public static ConsistencyLevel consistencyLevelFromString(String value) {
    switch (value.toUpperCase(Locale.ROOT)) {
    case "ANY":
        return ConsistencyLevel.ANY;
    case "ONE":
        return ConsistencyLevel.ONE;
    case "TWO":
        return ConsistencyLevel.TWO;
    case "THREE":
        return ConsistencyLevel.THREE;
    case "QUORUM":
        return ConsistencyLevel.QUORUM;
    case "ALL":
        return ConsistencyLevel.ALL;
    case "LOCAL_QUORUM":
        return ConsistencyLevel.LOCAL_QUORUM;
    case "EACH_QUORUM":
        return ConsistencyLevel.EACH_QUORUM;
    case "SERIAL":
        return ConsistencyLevel.SERIAL;
    case "LOCAL_SERIAL":
        return ConsistencyLevel.LOCAL_SERIAL;
    case "LOCAL_ONE":
        return ConsistencyLevel.LOCAL_ONE;
    default:/*from   w w  w  . j a va2 s.  co m*/
        throw new IllegalArgumentException("No write consistency match [" + value + "]");
    }
}

From source file:org.elasticsearch.action.WriteConsistencyLevel.java

License:Apache License

public ConsistencyLevel toCassandraConsistencyLevel() {
    switch (id) {
    case 1://from w  w w .  j  ava 2  s .  c  o m
        return ConsistencyLevel.LOCAL_ONE;
    case 2:
        return ConsistencyLevel.LOCAL_QUORUM;
    case 3:
        return ConsistencyLevel.ALL;
    }
    return ConsistencyLevel.LOCAL_ONE;
}

From source file:org.elasticsearch.cluster.ClusterService.java

License:Apache License

@SuppressForbidden(reason = "toUpperCase() for consistency level")
public static ConsistencyLevel consistencyLevelFromString(String value) {
    switch (value.toUpperCase()) {
    case "ANY":
        return ConsistencyLevel.ANY;
    case "ONE":
        return ConsistencyLevel.ONE;
    case "TWO":
        return ConsistencyLevel.TWO;
    case "THREE":
        return ConsistencyLevel.THREE;
    case "QUORUM":
        return ConsistencyLevel.QUORUM;
    case "ALL":
        return ConsistencyLevel.ALL;
    case "LOCAL_QUORUM":
        return ConsistencyLevel.LOCAL_QUORUM;
    case "EACH_QUORUM":
        return ConsistencyLevel.EACH_QUORUM;
    case "SERIAL":
        return ConsistencyLevel.SERIAL;
    case "LOCAL_SERIAL":
        return ConsistencyLevel.LOCAL_SERIAL;
    case "LOCAL_ONE":
        return ConsistencyLevel.LOCAL_ONE;
    default:/*  w ww. ja v a 2  s  .c o m*/
        throw new IllegalArgumentException("No write consistency match [" + value + "]");
    }
}