Class RingInstance

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.cassandra.spark.common.model.CassandraInstance, org.apache.cassandra.spark.data.model.TokenOwner

    public class RingInstance
    extends java.lang.Object
    implements org.apache.cassandra.spark.common.model.CassandraInstance, java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      RingInstance​(o.a.c.sidecar.client.shaded.common.response.data.RingEntry ringEntry)  
      RingInstance​(o.a.c.sidecar.client.shaded.common.response.data.RingEntry ringEntry, java.lang.String clusterId)  
      RingInstance​(o.a.c.sidecar.client.shaded.common.response.TokenRangeReplicasResponse.ReplicaMetadata replica)  
      RingInstance​(o.a.c.sidecar.client.shaded.common.response.TokenRangeReplicasResponse.ReplicaMetadata replica, java.lang.String clusterId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String clusterId()  
      java.lang.String datacenter()  
      boolean equals​(java.lang.Object other)
      Custom equality that compares the token, fully qualified domain name, the port, the datacenter and the clusterId Note that node state, status, are not part of the calculation.
      int hashCode()
      Custom hashCode that compares the token, fully qualified domain name, the port, and the datacenter Note that node state and status are not part of the calculation.
      java.lang.String ipAddress()  
      java.lang.String ipAddressWithPort()  
      java.lang.String nodeName()  
      org.apache.cassandra.spark.common.model.NodeState nodeState()  
      org.apache.cassandra.spark.common.model.NodeStatus nodeStatus()  
      o.a.c.sidecar.client.shaded.common.response.data.RingEntry ringEntry()  
      java.lang.String token()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • RingInstance

        public RingInstance​(o.a.c.sidecar.client.shaded.common.response.TokenRangeReplicasResponse.ReplicaMetadata replica,
                            @Nullable
                            java.lang.String clusterId)
      • RingInstance

        public RingInstance​(o.a.c.sidecar.client.shaded.common.response.data.RingEntry ringEntry)
      • RingInstance

        public RingInstance​(o.a.c.sidecar.client.shaded.common.response.data.RingEntry ringEntry,
                            @Nullable
                            java.lang.String clusterId)
      • RingInstance

        public RingInstance​(o.a.c.sidecar.client.shaded.common.response.TokenRangeReplicasResponse.ReplicaMetadata replica)
    • Method Detail

      • token

        public java.lang.String token()
        Specified by:
        token in interface org.apache.cassandra.spark.data.model.TokenOwner
      • clusterId

        @Nullable
        public java.lang.String clusterId()
        Specified by:
        clusterId in interface org.apache.cassandra.spark.common.model.CassandraInstance
      • nodeName

        public java.lang.String nodeName()
        Specified by:
        nodeName in interface org.apache.cassandra.spark.common.model.CassandraInstance
      • datacenter

        public java.lang.String datacenter()
        Specified by:
        datacenter in interface org.apache.cassandra.spark.common.model.CassandraInstance
      • ipAddress

        public java.lang.String ipAddress()
        Specified by:
        ipAddress in interface org.apache.cassandra.spark.common.model.CassandraInstance
      • ipAddressWithPort

        public java.lang.String ipAddressWithPort()
        Specified by:
        ipAddressWithPort in interface org.apache.cassandra.spark.common.model.CassandraInstance
      • nodeState

        public org.apache.cassandra.spark.common.model.NodeState nodeState()
        Specified by:
        nodeState in interface org.apache.cassandra.spark.common.model.CassandraInstance
      • nodeStatus

        public org.apache.cassandra.spark.common.model.NodeStatus nodeStatus()
        Specified by:
        nodeStatus in interface org.apache.cassandra.spark.common.model.CassandraInstance
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object other)
        Custom equality that compares the token, fully qualified domain name, the port, the datacenter and the clusterId Note that node state, status, are not part of the calculation.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        other - the other instance
        Returns:
        true if both instances are equal, false otherwise
      • hashCode

        public int hashCode()
        Custom hashCode that compares the token, fully qualified domain name, the port, and the datacenter Note that node state and status are not part of the calculation.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hashcode of this instance based on the important fields
      • toString

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

        public o.a.c.sidecar.client.shaded.common.response.data.RingEntry ringEntry()