Class IndexRouting
java.lang.Object
org.elasticsearch.cluster.routing.IndexRouting
Generates the shard id for
(id, routing) pairs.-
Method Summary
Modifier and TypeMethodDescriptionabstract voidcollectSearchShards(String routing, IntConsumer consumer) Collect all of the shard ids that *may* contain documents with the providedrouting.static IndexRoutingfromIndexMetadata(IndexMetadata indexMetadata) Build the routing fromIndexMetadata.protected final inthashToShardId(int hash) Convert a hash generated from an(id, routing) pair into a shard id.abstract intGenerate the single shard id that should contain a document with the providedidandrouting.
-
Method Details
-
fromIndexMetadata
Build the routing fromIndexMetadata. -
shardId
Generate the single shard id that should contain a document with the providedidandrouting. -
collectSearchShards
Collect all of the shard ids that *may* contain documents with the providedrouting. Indices with arouting_partitionwill 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.
-