Dear Wiki user, You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.
The following page has been changed by JoeStump: http://wiki.apache.org/cassandra/API The comment on the change is: Added notes on ConsistencyLevel. ------------------------------------------------------------------------------ UnavailableException:: Not all the replicas required could be created and/or read. TApplicationException:: Internal server error. + == Structures == + + === ConsistencyLevel === + + The `ConsistencyLevel` is an `enum` that controls both read and write behavior based on `<ReplicationFactor>` in your `storage-conf.xml`. The different consistency levels have different meanings, depending on if you're doing a write or read operation. + + ==== Write ==== + + ||'''Level'''||'''Behavior'''|| + ||`ZERO`||Only ensure that the write has been written to the commit log.|| + ||`ONE`||Ensure that the write has been written to at least 1 node's commit log and memory table.|| + ||`QUORUM`||Ensure that the write has been written to `<ReplicationFactor> / 2 + 1` nodes.|| + ||`ALL`||Ensure that the write is written to `<ReplicationFactor>` nodes.|| + + ==== Read ==== + + ||'''Level'''||'''Behavior'''|| + ||`ZERO`||Not supported.|| + ||`ONE`||Will return the record returned by the first node to respond. A background thread is always fired off to fix any consistency issues when `ConsistencyLevel.ONE` is used. This means subsequent calls will have correct data while the initial read may not.|| + ||`QUORUM`||Will query all storage nodes and return the record that is prevailing in consistency. For instance, if `foo = 1` on nodes A and B, while `foo = 2` on node C then the prevailing consistency is `foo = 1`. A background thread will be fired off to fix consistency issues.|| + ||`ALL`||Not supported.|| +
