Enum cdrs::consistency::Consistency [−][src]
pub enum Consistency { Any, One, Two, Three, Quorum, All, LocalQuorum, EachQuorum, Serial, LocalSerial, LocalOne, Unknown, }
Consistency
is an enum which represents Cassandra's consistency levels.
To find more details about each consistency level please refer to Cassandra official docs.
Variants
Any
A write must be written to the commit log and memtable on all replica nodes in the cluster for that partition key. Provides the highest consistency and the lowest availability of any other level.
One
A write must be written to the commit log and memtable of at least one replica node. Satisfies the needs of most users because consistency requirements are not stringent.
Two
A write must be written to the commit log and memtable of at least two replica nodes. Similar to ONE.
Three
A write must be written to the commit log and memtable of at least three replica nodes. Similar to TWO.
Quorum
A write must be written to the commit log and memtable on a quorum of replica nodes. Provides strong consistency if you can tolerate some level of failure.
All
A write must be written to the commit log and memtable on all replica nodes in the cluster for that partition key. Provides the highest consistency and the lowest availability of any other level.
LocalQuorum
Strong consistency. A write must be written to the commit log and memtable on a quorum of replica nodes in the same data center as thecoordinator node. Avoids latency of inter-data center communication. Used in multiple data center clusters with a rack-aware replica placement strategy, such as NetworkTopologyStrategy, and a properly configured snitch. Use to maintain consistency locally (within the single data center). Can be used with SimpleStrategy.
EachQuorum
Strong consistency. A write must be written to the commit log and memtable on a quorum of replica nodes in all data center. Used in multiple data center clusters to strictly maintain consistency at the same level in each data center. For example, choose this level if you want a read to fail when a data center is down and the QUORUM cannot be reached on that data center.
Serial
Achieves linearizable consistency for lightweight transactions by preventing unconditional updates. You cannot configure this level as a normal consistency level, configured at the driver level using the consistency level field. You configure this level using the serial consistency field as part of the native protocol operation. See failure scenarios.
LocalSerial
Same as SERIAL but confined to the data center. A write must be written conditionally to the commit log and memtable on a quorum of replica nodes in the same data center. Same as SERIAL. Used for disaster recovery. See failure scenarios.
LocalOne
A write must be sent to, and successfully acknowledged by, at least one replica node in the local data center. In a multiple data center clusters, a consistency level of ONE is often desirable, but cross-DC traffic is not. LOCAL_ONE accomplishes this. For security and quality reasons, you can use this consistency level in an offline datacenter to prevent automatic connection to online nodes in other data centers if an offline node goes down.
Unknown
This is an error scenario either the client code doesn't support it or server is sending bad headers
Trait Implementations
impl Debug for Consistency
[src]
impl Debug for Consistency
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Consistency
[src]
impl PartialEq for Consistency
fn eq(&self, other: &Consistency) -> bool
[src]
fn eq(&self, other: &Consistency) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Clone for Consistency
[src]
impl Clone for Consistency
fn clone(&self) -> Consistency
[src]
fn clone(&self) -> Consistency
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Consistency
[src]
impl Copy for Consistency
impl Default for Consistency
[src]
impl Default for Consistency
fn default() -> Consistency
[src]
fn default() -> Consistency
Returns the "default value" for a type. Read more
impl IntoBytes for Consistency
[src]
impl IntoBytes for Consistency
fn into_cbytes(&self) -> Vec<u8>
[src]
fn into_cbytes(&self) -> Vec<u8>
It should convert a struct into an array of bytes.
impl From<i32> for Consistency
[src]
impl From<i32> for Consistency
fn from(bytes: i32) -> Consistency
[src]
fn from(bytes: i32) -> Consistency
Performs the conversion.
impl FromBytes for Consistency
[src]
impl FromBytes for Consistency
fn from_bytes(bytes: &[u8]) -> Result<Consistency>
[src]
fn from_bytes(bytes: &[u8]) -> Result<Consistency>
It gets and array of bytes and should return an implementor struct.
impl FromCursor for Consistency
[src]
impl FromCursor for Consistency
fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result<Consistency>
[src]
fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result<Consistency>
It should return an implementor from an io::Cursor
over an array of bytes.
Auto Trait Implementations
impl Send for Consistency
impl Send for Consistency
impl Sync for Consistency
impl Sync for Consistency