Class CollectedClaimsImpl

java.lang.Object
com.illumon.iris.db.v2.routing.impl.yaml.CollectedClaimsImpl
All Implemented Interfaces:
CollectedClaims

public class CollectedClaimsImpl extends Object implements CollectedClaims
Implementation of CollectedClaims. Stores the data in maps, and adds methods for building up the collection. This implementation stays mutable, add synchronization externally as necessary.
  • Constructor Details

    • CollectedClaimsImpl

      public CollectedClaimsImpl()
  • Method Details

    • getNamespaceClaims

      public Map<String,String> getNamespaceClaims()
      Description copied from interface: CollectedClaims
      Get the set of claimed namespaces. This is entire namespaces that have been claimed, but individual claims on a table in the namespace will override the claim for that table.
      Specified by:
      getNamespaceClaims in interface CollectedClaims
      Returns:
      map of namespace to claimant
    • getTableClaims

      public Map<String,Map<String,String>> getTableClaims()
      Description copied from interface: CollectedClaims
      Get the set of claimed tables.
      Specified by:
      getTableClaims in interface CollectedClaims
      Returns:
      map of namespace to (map of table to claimant)
    • claim

      public void claim(@NotNull String claimant, @NotNull String namespace, @NotNull String tableName)
      Register the table to the claimant.
      Parameters:
      claimant - who is claiming this table
      namespace - namespace of the table being claimed
      tableName - table to claim
    • claim

      public void claim(@NotNull String claimant, @NotNull String namespace)
      Register the namespace to the claimant.
      Parameters:
      claimant - who is claiming this table
      namespace - namespace to claim
    • claimedBy

      @Nullable public String claimedBy(@NotNull CharSequence namespace, @NotNull CharSequence tableName)
      return the name of the DIS or failover group that has claim on this table, or null if none.
      Specified by:
      claimedBy in interface CollectedClaims
      Parameters:
      namespace - namespace of the table to be checked
      tableName - name of the table to be checked
      Returns:
      the name of the DIS or failover group that has claimed this table, null if no claim
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object