Module org.elasticsearch.server
Class IndexRouting.ExtractFromSource
java.lang.Object
org.elasticsearch.cluster.routing.IndexRouting
org.elasticsearch.cluster.routing.IndexRouting.ExtractFromSource
- Direct Known Subclasses:
IndexRouting.ExtractFromSource.ForIndexDimensions,IndexRouting.ExtractFromSource.ForRoutingPath
- Enclosing class:
IndexRouting
Base class for strategies that determine the shard by extracting and hashing fields from the document source.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStrategy for time-series indices that useIndexMetadata.INDEX_DIMENSIONSto extract the tsid from the source.static classStrategy for indices that useIndexMetadata.INDEX_ROUTING_PATHto extract the routing value from the source.Nested classes/interfaces inherited from class org.elasticsearch.cluster.routing.IndexRouting
IndexRouting.ExtractFromSource -
Field Summary
FieldsFields inherited from class org.elasticsearch.cluster.routing.IndexRouting
indexName -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck if the _split index operation is allowed for an indexvoidcollectSearchShards(String routing, IntConsumer consumer) Collect all of the shard ids that *may* contain documents with the providedrouting.intdeleteShard(String id, String routing) Called when deleting a document to generate the shard id that should contain a document with the provided_idand (optional)_routing.intCalled when getting a document to generate the shard id that should contain a document with the provided_idand (optional)_routing.protected static inthash(org.apache.lucene.util.BytesRef ref) protected abstract inthashSource(IndexRequest indexRequest) intindexShard(IndexRequest indexRequest) Called when indexing a document to generate the shard id that should contain a document with the provided parameters.voidpostProcess(IndexRequest indexRequest) Finalize the request after routing, incorporating data produced by the routing logic.intupdateShard(String id, String routing) Called when updating a document to generate the shard id that should contain a document with the provided_idand (optional)_routing.Methods inherited from class org.elasticsearch.cluster.routing.IndexRouting
fromIndexMetadata, hashToShardId, preProcess, rerouteSearchIfResharding, rerouteWritesIfResharding
-
Field Details
-
parserConfig
-
-
Method Details
-
postProcess
Description copied from class:IndexRoutingFinalize the request after routing, incorporating data produced by the routing logic.- Overrides:
postProcessin classIndexRouting
-
indexShard
Description copied from class:IndexRoutingCalled when indexing a document to generate the shard id that should contain a document with the provided parameters.- Specified by:
indexShardin classIndexRouting
-
hashSource
-
hash
protected static int hash(org.apache.lucene.util.BytesRef ref) -
updateShard
Description copied from class:IndexRoutingCalled when updating a document to generate the shard id that should contain a document with the provided_idand (optional)_routing.- Specified by:
updateShardin classIndexRouting
-
deleteShard
Description copied from class:IndexRoutingCalled when deleting a document to generate the shard id that should contain a document with the provided_idand (optional)_routing.- Specified by:
deleteShardin classIndexRouting
-
getShard
Description copied from class:IndexRoutingCalled when getting a document to generate the shard id that should contain a document with the provided_idand (optional)_routing.- Specified by:
getShardin classIndexRouting
-
checkIndexSplitAllowed
public void checkIndexSplitAllowed()Description copied from class:IndexRoutingCheck if the _split index operation is allowed for an index- Overrides:
checkIndexSplitAllowedin classIndexRouting
-
collectSearchShards
Description copied from class:IndexRoutingCollect 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 byIndexRouting.getShard(java.lang.String, java.lang.String).Note: This is called for any search-like requests that have a routing specified but only if they have a routing specified. If they do not have a routing they just use all shards in the index.
- Specified by:
collectSearchShardsin classIndexRouting
-