Interface IracTombstoneManager

All Known Implementing Classes:
DefaultIracTombstoneManager, NoOpIracTombstoneManager

public interface IracTombstoneManager
Stores and manages tombstones for removed keys.

It manages the tombstones for IRAC protocol. Tombstones are used when a key is removed but the version/metadata is required to perform conflict or duplicates detection.

Tombstones are removed when they are not required by any site or its value is updated (with a non-null value).

Since:
14.0
  • Method Details

    • storeTombstone

      void storeTombstone(int segment, Object key, IracMetadata metadata)
      Stores a tombstone for a removed key.

      It overwrites any previous tombstone associated to the key.

      Parameters:
      segment - The key's segment.
      key - The key.
      metadata - The IracMetadata.
    • storeTombstoneIfAbsent

      default void storeTombstoneIfAbsent(int segment, Object key, IracMetadata metadata)
      Same as storeTombstone(int, Object, IracMetadata) but it doesn't overwrite an existing tombstone.
      Parameters:
      segment - The key's segment.
      key - The key.
      metadata - The IracMetadata.
    • storeTombstoneIfAbsent

      void storeTombstoneIfAbsent(IracTombstoneInfo tombstone)
      Parameters:
      tombstone - The tombstone to store.
    • removeTombstone

      void removeTombstone(IracTombstoneInfo tombstone)
      Removes the tombstone if it matches.
      Parameters:
      tombstone - The IracTombstoneInfo.
    • removeTombstone

      void removeTombstone(Object key)
      Removes the tombstone for key.
      Parameters:
      key - The key.
    • getTombstone

      IracMetadata getTombstone(Object key)
      Returns the tombstone associated to the key or null if it doesn't exist.
      Parameters:
      key - The key.
      Returns:
      The tombstone.
    • isEmpty

      boolean isEmpty()
      Returns:
      true if no tombstones are stored.
    • size

      int size()
      Returns:
      the number of tombstones stored.
    • isTaskRunning

      boolean isTaskRunning()
      Returns:
      true if the cleanup task is currently running.
    • getCurrentDelayMillis

      long getCurrentDelayMillis()
      Returns:
      The current delay between cleanup task in milliseconds.
    • sendStateTo

      void sendStateTo(Address requestor, IntSet segments)
      Sends the tombstone belonging to the segments in segment to the originator

      The sending is done asynchronously, and it does not wait for the sending to complete.

      Parameters:
      requestor - The requestor Address.
      segments - The segments requested.
    • checkStaleTombstone

      void checkStaleTombstone(Collection<? extends IracTombstoneInfo> tombstones)
      It receives a Collection of IracTombstoneInfo and sends IracTombstoneCleanupCommand for the tombstone no longer valid.
      Parameters:
      tombstones - The IracTombstoneInfo collection.