Class NoSQLSubscriberId


  • public class NoSQLSubscriberId
    extends java.lang.Object
    Object to represent a subscriber id in a subscription group. When user creates a subscription group with multiple subscribers, each covering a disjoint subset of shards, user need to specify the NoSQLSubscriberId for each subscriber in that group.

    In addition to the checkpoint table name, the index consists of two parts, 1) the total number of subscribers in the group, and 2) the index of the given subscriber. The index must be fall in the range between 0 inclusively, and the total number of subscribers exclusively. For example, assume a subscription group with 3 subscribers, each covering a portion of the shards in source store, the index of the 3 subscribers should be 0, 1 and 2, respectively.

    • Constructor Summary

      Constructors 
      Constructor Description
      NoSQLSubscriberId​(int total, int index)
      Constructs a NoSQLSubscriber Id, which identifies a subscriber in the context of a subscription that is uniquely identified by the checkpoint table.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int getIndex()
      Gets subscriber index in the group.
      int getTotal()
      Gets total number of subscribers in the group.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NoSQLSubscriberId

        public NoSQLSubscriberId​(int total,
                                 int index)
                          throws java.lang.IllegalArgumentException
        Constructs a NoSQLSubscriber Id, which identifies a subscriber in the context of a subscription that is uniquely identified by the checkpoint table.
        Parameters:
        total - total number of members in the group
        index - index of subscriber
        Throws:
        java.lang.IllegalArgumentException - if total is than less or equal to 0, or index is not in range between 0 inclusively and the total number of subscribers exclusively, or the groupId is null or empty.
    • Method Detail

      • getTotal

        public int getTotal()
        Gets total number of subscribers in the group.
        Returns:
        total number of subscribers in the group
      • getIndex

        public int getIndex()
        Gets subscriber index in the group.
        Returns:
        subscriber index in the group
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object