Enum ConsistencyLevel

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ConsistencyLevel>

    public enum ConsistencyLevel
    extends java.lang.Enum<ConsistencyLevel>
    • Field Detail

      • code

        public final int code
    • Method Detail

      • values

        public static ConsistencyLevel[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ConsistencyLevel c : ConsistencyLevel.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ConsistencyLevel valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • fromString

        public static ConsistencyLevel fromString​(java.lang.String str)
      • eachQuorumForRead

        public static com.carrotsearch.hppc.ObjectIntHashMap<java.lang.String> eachQuorumForRead​(AbstractReplicationStrategy replicationStrategy)
      • eachQuorumForWrite

        public static com.carrotsearch.hppc.ObjectIntHashMap<java.lang.String> eachQuorumForWrite​(AbstractReplicationStrategy replicationStrategy,
                                                                                                  Endpoints<?> pendingWithDown)
      • satisfies

        public boolean satisfies​(ConsistencyLevel other,
                                 AbstractReplicationStrategy replicationStrategy)
        Determine if this consistency level meets or exceeds the consistency requirements of the given cl for the given keyspace WARNING: this is not locality aware; you cannot safely use this with mixed locality consistency levels (e.g. LOCAL_QUORUM and QUORUM)
      • isDatacenterLocal

        public boolean isDatacenterLocal()
      • isSerialConsistency

        public boolean isSerialConsistency()
      • needsReconciliation

        public boolean needsReconciliation()
        With a replication factor greater than one, reads that contact more than one replica will require reconciliation of the individual replica results at the coordinator.
        Returns:
        true if reads at this consistency level require merging at the coordinator