Database Reference
In-Depth Information
org.apache.cassandra.db.CompactionManager . CompactionManager implements an
MBean interface so it can be introspected.
There are different types of compaction in Cassandra.
A majorcompaction is triggered in one of two ways: via a node probe or automatically. A
node probe sends a TreeRequest message to the nodes that neighbor the target. When a node
receives a TreeRequest, it immediately performs a read-onlycompactionin order to validate
the column family.
A read-only compaction has the following steps:
1. Get the key distribution from the column family.
2. Once the rows have been added to the validator, if the column family needs to be val-
idated, it will create the Merkle tree and broadcast it to the neighboring nodes.
3. The Merkle trees are brought together in a “rendezvous” as a list of Differencers
(trees that need validating or comparison).
4. The comparison is executed by the StageManager class, which is responsible for
handling concurrency issues in executing jobs. In this case, the StageManager uses
an anti-entropy stage. This uses the org.apache.cassandra.concur-
rent.JMXEnabledThreadPoolExecutor class, which executes the compaction
within a single thread and makes the operation available as an MBean for inspection.
Compressiion
Data compression on return is on the road map for future versions, but as of 0.6 it is not yet
supported.
Consiisttency
Consistency means that a transaction does not leave the database in an illegal state, and that
no integrity constraints are violated. This is considered a crucial aspect of transactions in re-
lational databases and is one of the ACID properties (Atomic, Consistent, Isolated, Durable).
In Cassandra, the relative degree of consistency can be calculated by the following:
N = the number of nodes that store replicas of the data
W = the number of replicas that must acknowledge receipt of a write before it can be said to
be successful
R = the number of replicas that are contacted when a data object is accessed in a read oper-
ation
W + R > N = strong consistency
Search WWH ::




Custom Search