Interface IEndpointSnitch

    • Method Detail

      • getRack

        java.lang.String getRack​(InetAddressAndPort endpoint)
        returns a String representing the rack the given endpoint belongs to
      • getLocalRack

        default java.lang.String getLocalRack()
        returns a String representing the rack current endpoint belongs to
      • getDatacenter

        java.lang.String getDatacenter​(InetAddressAndPort endpoint)
        returns a String representing the datacenter the given endpoint belongs to
      • getLocalDatacenter

        default java.lang.String getLocalDatacenter()
        returns a String representing the datacenter current endpoint belongs to
      • getDatacenter

        default java.lang.String getDatacenter​(java.net.InetSocketAddress endpoint)
      • getDatacenter

        default java.lang.String getDatacenter​(Replica replica)
      • sortedByProximity

        <C extends ReplicaCollection<? extends C>> C sortedByProximity​(InetAddressAndPort address,
                                                                       C addresses)
        returns a new List sorted by proximity to the given endpoint
      • compareEndpoints

        int compareEndpoints​(InetAddressAndPort target,
                             Replica r1,
                             Replica r2)
        compares two endpoints in relation to the target endpoint, returning as Comparator.compare would
      • gossiperStarting

        void gossiperStarting()
        called after Gossiper instance exists immediately before it starts gossiping
      • isWorthMergingForRangeQuery

        boolean isWorthMergingForRangeQuery​(ReplicaCollection<?> merged,
                                            ReplicaCollection<?> l1,
                                            ReplicaCollection<?> l2)
        Returns whether for a range query doing a query against merged is likely to be faster than 2 sequential queries, one against l1 followed by one against l2.
      • validate

        default boolean validate​(java.util.Set<java.lang.String> datacenters,
                                 java.util.Set<java.lang.String> racks)
        Determine if the datacenter or rack values in the current node's snitch conflict with those passed in parameters.