Interface ReadableDistributedMetaStorage

  • All Known Subinterfaces:
    DistributedMetaStorage
    All Known Implementing Classes:
    DistributedMetaStorageImpl

    public interface ReadableDistributedMetaStorage
    API for distributed data storage. Gives the ability to store configuration data (or any other data) consistently and cluster-wide. It is guaranteed that every read value is the same on every node in the cluster all the time.
    • Method Detail

      • getUpdatesCount

        long getUpdatesCount()
        Get the total number of updates (write/remove) that metastorage ever had.
      • iterate

        void iterate​(@NotNull
                     @NotNull String keyPrefix,
                     @NotNull
                     @NotNull BiConsumer<String,​? super Serializable> cb)
              throws IgniteCheckedException
        Iterate over all values corresponding to the keys with given prefix. It is guaranteed that iteration will be executed in ascending keys order.
        Parameters:
        keyPrefix - Prefix for the keys that will be iterated.
        cb - Callback that will be applied to all <key, value> pairs.
        Throws:
        IgniteCheckedException - If reading or unmarshalling failed.
      • listen

        void listen​(@NotNull
                    @NotNull Predicate<String> keyPred,
                    DistributedMetaStorageListener<?> lsnr)
        Add listener on data updates. Updates happens it two cases:
        • Some node invoked write or remove. Listeners are invoked after update update operation is already completed.
        • Node is just started and not ready for write yet. In this case listeners are invoked for every key with new value (retrieved from the clueter) or already existing value if there was no updates for given key. This guarantees that all listeners are invoked for all updates in case of failover.
        Parameters:
        keyPred - Predicate to check whether this listener should be invoked on given key update or not.
        lsnr - Listener object.
        See Also:
        DistributedMetaStorageListener