Class DcrStorage

java.lang.Object
org.gridgain.internal.dcr.metastorage.DcrStorage

public class DcrStorage extends Object
Replication storage based on metastorage MetaStorageManager.
  • Constructor Details

    • DcrStorage

      public DcrStorage(org.apache.ignite.internal.metastorage.MetaStorageManager manager)
      Constructor.
      Parameters:
      manager - Meta storage manager.
  • Method Details

    • registerStoreListener

      public org.gridgain.internal.lang.Disposable registerStoreListener(DcrStorageListener listener)
      Registers storage listener.
      Parameters:
      listener - Store listener to register.
    • put

      public CompletableFuture<Boolean> put(String name, ReplicationEntry entry)
      Persists replication to storage.
      Parameters:
      name - Replication name.
      entry - Replication options.
      Returns:
      Future with true result if status updated successfully.
    • findByNode

      public CompletableFuture<Map<String,ReplicationEntry>> findByNode(String nodeName)
      Find all replications by worker node.
      Parameters:
      nodeName - Worker node name.
      Returns:
      Future with list of replications which hosted on provided node.
    • get

      Returns stored replication options by provided identifier.
      Parameters:
      name - Replication name.
      Returns:
      Future with options result or null in case when replication with provided identifier doesn't exist.
    • getAll

      Returns all stored replication entries.
      Returns:
      Future with list of replication entries.
    • remove

      public CompletableFuture<Boolean> remove(String name)
      Removes replication from storage.
      Parameters:
      name - Replication name.
      Returns:
      Future with true result if status updated successfully.
    • remove

      public CompletableFuture<Boolean> remove(String name, Predicate<ReplicationEntry> checker)
      Removes replication from storage if it satisfies the supplied predicate.
      Parameters:
      name - Replication name.
      checker - Predicate to apply to the replication to determine if it should be deleted.
      Returns:
      Future with true result if status updated successfully.
    • update

      public CompletableFuture<Boolean> update(String name, Function<ReplicationEntry,ReplicationEntry> func, boolean withRetry)
      Update entry.
      Parameters:
      name - Replication name.
      func - Update function.
      Returns:
      Future with true result if status updated successfully.