Class PlacementRequestImpl

    • Constructor Detail

      • PlacementRequestImpl

        public PlacementRequestImpl​(SolrCollection solrCollection,
                                    Set<String> shardNames,
                                    Set<Node> targetNodes,
                                    int countNrtReplicas,
                                    int countTlogReplicas,
                                    int countPullReplicas)
    • Method Detail

      • getShardNames

        public Set<String> getShardNames()
        Description copied from interface: PlacementRequest
        Shard name(s) for which new replicas placement should be computed. The shard(s) might exist or not (that's why this method returns a Set of String's and not directly a set of Shard instances).

        Note the Collection API allows specifying the shard name or a _route_ parameter. The Solr implementation will convert either specification into the relevant shard name so the plugin code doesn't have to worry about this.

        Specified by:
        getShardNames in interface PlacementRequest
      • getTargetNodes

        public Set<Node> getTargetNodes()
        Description copied from interface: PlacementRequest
        Replicas should only be placed on nodes in the set returned by this method.

        When Collection API calls do not specify a specific set of target nodes, replicas can be placed on any live node of the cluster. In such cases, this set will be equal to the set of all live nodes. The plugin placement code does not need to worry (or care) if a set of nodes was explicitly specified or not.

        Specified by:
        getTargetNodes in interface PlacementRequest
        never null and never empty set (if that set was to be empty for any reason, no placement would be possible and the Solr infrastructure driving the plugin code would detect the error itself rather than calling the plugin).