Class DistributedMetaStorageImpl

  • All Implemented Interfaces:
    GridComponent, IgniteChangeGlobalStateSupport, GridProcessor, DistributedMetaStorage, ReadableDistributedMetaStorage

    public class DistributedMetaStorageImpl
    extends GridProcessorAdapter
    implements DistributedMetaStorage, IgniteChangeGlobalStateSupport

    Implementation of DistributedMetaStorage based on MetaStorage for persistence and discovery SPI for communication.

    It is based on existing local metastorage API for persistent clusters (in-memory clusters and client nodes will store data in memory). Write/remove operation use Discovery SPI to send updates to the cluster, it guarantees updates order and the fact that all existing (alive) nodes have handled the update message.

    As a way to find out which node has the latest data there is a "version" value of distributed metastorage, (DistributedMetaStorageVersion) which is basically the pair <number of all updates, hash of all updates>. First element of the pair is the value of getUpdatesCount().

    Whole updates history until some point in the past is stored along with the data, so when an outdated node connects to the cluster it will receive all the missing data and apply it locally. Listeners will also be invoked after such updates. If there's not enough history stored or joining node is clear then it'll receive shapshot of distributed metastorage (usually called fullData in code) so there won't be inconsistencies.

    See Also:
    DistributedMetaStorageUpdateMessage, DistributedMetaStorageUpdateAckMessage