com.hazelcast.crdt

## Interface CRDT<T extends CRDT<T>>

- Type Parameters:
    `T` -
  All Known Implementing Classes:
    PNCounterImpl

      public interface CRDT<T extends CRDT<T>>

  Common interface for CRDT (conflict-free replicated data type) implementations. The common behaviour for all implementations is that they have a strong eventual consistency property - two nodes that have received the same set of updates, possibly in a different order, will have an identical shared state and any conflicting updates are merged automatically. All operations on the CRDT implementations are performed locally without any coordination with the other replicas of the same data. This allows for higher availability but can present data loss in some scenarios, e.g. the node is killed right after it receives an update. In split brain scenarios, each replica should keep it's local state and once the split brain is healed, the state of the replicas that were unreachable during split brain as well as the local state will converge to the same state. The CRDT state can be versioned in which case it will increase the version number on each mutation. This way, the replication mechanism will be able to replicate only those states which have not yet been replicated and avoid replication in a quiescent state.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.hazelcast.cluster.impl.VectorClock` | `getCurrentVectorClock()` Returns the current vector clock which reflects the current CRDT state.
    `void` | `merge(T other)` Merges the state of a different replica into this CRDT.

- - ### Method Detail

    - #### merge

          void merge(T other)

      Merges the state of a different replica into this CRDT. The merge method should not leave the CRDT in a failed state.
      Parameters:
        `other` - the CRDT to merge into this CRDT

    - #### getCurrentVectorClock

          com.hazelcast.cluster.impl.VectorClock getCurrentVectorClock()

      Returns the current vector clock which reflects the current CRDT state.

Copyright © 2020. All rights reserved.