Interface Shard


public interface Shard
Shard in a SolrCollection, i.e. a subset of the data indexed in that collection.
  • Method Details

    • getShardName

      String getShardName()
    • getCollection

      SolrCollection getCollection()
      Returns:
      the collection this shard is part of
    • getUniqueShardId

      default String getUniqueShardId()
      Returns:
      an id for this shard that is unique across the cluster, combining the collection name and the shard name. Useful e.g. as a map key when grouping replicas of the same shard, possibly from different collections.
    • getReplica

      Replica getReplica(String name)
      Returns the Replica of the given name for that shard, if such a replica exists.
      Returns:
      null if the replica does not (or does not yet) exist for the shard.
    • iterator

      Iterator<Replica> iterator()
      Returns:
      an iterator over Replicas already existing for this Shard.
    • replicas

      Iterable<Replica> replicas()
      Allow foreach iteration on replicas such as: for (Replica r : shard.replicas()) {...}.
    • getLeader

      Replica getLeader()
      Returns:
      the current leader Replica for this Shard. Note that by the time this method returns the leader might have changed. Also, if there's no leader for any reason (don't shoot the messenger), this method will return null.
    • getState

      Shard.ShardState getState()