Class ReplicaSet

java.lang.Object
io.debezium.connector.mongodb.connection.ReplicaSet
All Implemented Interfaces:
Comparable<ReplicaSet>

@Immutable public final class ReplicaSet extends Object implements Comparable<ReplicaSet>
  • Field Details

    • CLUSTER_RS_NAME

      public static final String CLUSTER_RS_NAME
      See Also:
    • replicaSetName

      private final String replicaSetName
    • connectionString

      private final com.mongodb.ConnectionString connectionString
    • hc

      private final int hc
  • Constructor Details

    • ReplicaSet

      public ReplicaSet(String connectionString)
    • ReplicaSet

      public ReplicaSet(com.mongodb.ConnectionString connectionString)
    • ReplicaSet

      private ReplicaSet(String replicaSetName, com.mongodb.ConnectionString connectionString)
  • Method Details

    • forCluster

      public static ReplicaSet forCluster(com.mongodb.ConnectionString connectionString)
      Creates a fake replica set representing entire sharded cluster
      Parameters:
      connectionString - connection string for sharded cluster
      Returns:
      sharded cluster as fake replica set
    • forCluster

      public static ReplicaSet forCluster(String connectionString)
    • replicaSetName

      public String replicaSetName()
      Get the name of this replica set.
      Returns:
      the replica set name, or null if the addresses are for standalone servers.
    • connectionString

      public com.mongodb.ConnectionString connectionString()
      Get connection string
      Returns:
      connection string for this replica set
    • hasReplicaSetName

      public boolean hasReplicaSetName()
      Return whether the address(es) represents a replica set, where the replica set name is not null.
      Returns:
      true if this represents the address of a replica set, or false if it represents the address of a standalone server
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(ReplicaSet that)
      Specified by:
      compareTo in interface Comparable<ReplicaSet>
    • toString

      public String toString()
      Overrides:
      toString in class Object