Class OrderedNodePlacementPlugin.WeightedNode

    • Constructor Detail

      • WeightedNode

        public WeightedNode​(Node node)
    • Method Detail

      • getNode

        public Node getNode()
      • getAllReplicasOnNode

        public Set<Replica> getAllReplicasOnNode()
      • getAllReplicaCount

        public int getAllReplicaCount()
      • getCollectionsOnNode

        public Set<String> getCollectionsOnNode()
      • hasCollectionOnNode

        public boolean hasCollectionOnNode​(String collection)
      • getShardsOnNode

        public Set<String> getShardsOnNode​(String collection)
      • hasShardOnNode

        public boolean hasShardOnNode​(Shard shard)
      • getReplicasForShardOnNode

        public Set<Replica> getReplicasForShardOnNode​(Shard shard)
      • calcWeight

        public abstract int calcWeight()
      • calcRelevantWeightWithReplica

        public abstract int calcRelevantWeightWithReplica​(Replica replica)
      • canAddReplica

        public boolean canAddReplica​(Replica replica)
      • initReplica

        public final void initReplica​(Replica replica)
      • initReplicaWeights

        protected void initReplicaWeights​(Replica replica)
      • addReplica

        public final boolean addReplica​(Replica replica)
      • addProjectedReplicaWeights

        protected abstract boolean addProjectedReplicaWeights​(Replica replica)
        Add the weights for the given replica to this node
        Parameters:
        replica - the replica to add weights for
        Returns:
        a whether the ordered list of nodes needs a resort afterwords.
      • canRemoveReplicas

        public Map<Replica,​String> canRemoveReplicas​(Collection<Replica> replicas)
        Determine if the given replicas can be removed from the node.
        Parameters:
        replicas - the replicas to remove
        Returns:
        a mapping from replicas that cannot be removed to the reason why they can't be removed.
      • removeReplica

        public final void removeReplica​(Replica replica)
      • removeProjectedReplicaWeights

        protected abstract void removeProjectedReplicaWeights​(Replica replica)
      • getTiebreaker

        protected Comparable getTiebreaker()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object