Class IndexRouting
java.lang.Object
org.elasticsearch.cluster.routing.IndexRouting
Generates the shard id for
(id, routing)
pairs.-
Method Summary
Modifier and TypeMethodDescriptionabstract void
collectSearchShards
(String routing, IntConsumer consumer) Collect all of the shard ids that *may* contain documents with the providedrouting
.static IndexRouting
fromIndexMetadata
(IndexMetadata indexMetadata) Build the routing fromIndexMetadata
.protected final int
hashToShardId
(int hash) Convert a hash generated from an(id, routing
) pair into a shard id.abstract int
Generate the single shard id that should contain a document with the providedid
androuting
.
-
Method Details
-
fromIndexMetadata
Build the routing fromIndexMetadata
. -
shardId
Generate the single shard id that should contain a document with the providedid
androuting
. -
collectSearchShards
Collect all of the shard ids that *may* contain documents with the providedrouting
. Indices with arouting_partition
will collect more than one shard. Indices without a partition will collect the same shard id as would be returned byshardId(java.lang.String, java.lang.String)
. -
hashToShardId
protected final int hashToShardId(int hash) Convert a hash generated from an(id, routing
) pair into a shard id.
-