Interface ScatteredVersionManager<K>

  • All Known Implementing Classes:

    public interface ScatteredVersionManager<K>
    Manages versions of entries and states of segments.
    Radim Vansa <>
    • Method Detail

      • incrementVersion

        EntryVersion incrementVersion​(int segment)
        Generates a new version for an entry in given segment.
        segment -
      • isVersionActual

        boolean isVersionActual​(int segment,
                                EntryVersion version)
        segment -
        version -
        True if the version was generated by this node after most recently becoming owner of the given segment.
      • scheduleKeyInvalidation

        void scheduleKeyInvalidation​(K key,
                                     EntryVersion version,
                                     boolean removal)
        Notifies the manager that an operation on given key with version previously retrieved from incrementVersion(int) has finished. This operation has to be executed on originator of the operation once the entry was stored on both nodes. Eventually order versions of entries will be removed on other nodes. When the entry was completely removed by the operation, the nodes have stored a tombstone of that entry. The older versions will be dropped regularly and after this is confirmed the tombstones will be invalidated, too.
        key -
        version -
        removal -
      • notifyKeyTransferFinished

        void notifyKeyTransferFinished​(int segment,
                                       boolean expectValues,
                                       boolean cancelled)
        All key + version data from given segment have been received, or the key transfer failed.
        segment -
        expectValues - True when the transfer failed and the segment will be moved to the ScatteredVersionManager.SegmentState.OWNED state without waiting for values.
        cancelled - True is the transfer was cancelled due to a new topology - in that case the segment will end up in ScatteredVersionManager.SegmentState.NOT_OWNED. This takes precedence over expectValues.
      • setValuesTransferTopology

        void setValuesTransferTopology​(int topologyId)
      • valuesFuture

        CompletableFuture<Void> valuesFuture​(int topologyId)
        A CompletableFuture that completes when value transfer has finished for the given topology id.
      • setTopologyId

        void setTopologyId​(int topologyId)
        Set current topology id.
        topologyId -
      • updatePreloadedEntryVersion

        void updatePreloadedEntryVersion​(EntryVersion version)
        This is called only during preload. Makes sure that the cache will start with topology higher than the one stored in a cache store.
        version -