Module org.elasticsearch.server
Class IndexRouting.ExtractFromSource
java.lang.Object
org.elasticsearch.cluster.routing.IndexRouting
org.elasticsearch.cluster.routing.IndexRouting.ExtractFromSource
- Enclosing class:
- IndexRouting
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.cluster.routing.IndexRouting
IndexRouting.ExtractFromSource
-
Field Summary
Fields inherited from class org.elasticsearch.cluster.routing.IndexRouting
indexName
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
void
Check if the _split index operation is allowed for an indexvoid
collectSearchShards
(String routing, IntConsumer consumer) Collect all of the shard ids that *may* contain documents with the providedrouting
.createId
(XContentType sourceType, BytesReference source, byte[] suffix) int
deleteShard
(String id, String routing) Called when deleting a document to generate the shard id that should contain a document with the provided_id
and (optional)_routing
.int
Called when getting a document to generate the shard id that should contain a document with the provided_id
and (optional)_routing
.int
indexShard
(String id, String routing, XContentType sourceType, BytesReference source, Consumer<String> routingHashSetter) Called when indexing a document to generate the shard id that should contain a document with the provided parameters.boolean
matchesField
(String fieldName) void
process
(IndexRequest indexRequest) int
updateShard
(String id, String routing) Called when updating a document to generate the shard id that should contain a document with the provided_id
and (optional)_routing
.Methods inherited from class org.elasticsearch.cluster.routing.IndexRouting
fromIndexMetadata, hashToShardId
-
Method Details
-
matchesField
-
process
- Specified by:
process
in classIndexRouting
-
indexShard
public int indexShard(String id, @Nullable String routing, XContentType sourceType, BytesReference source, Consumer<String> routingHashSetter) Description copied from class:IndexRouting
Called when indexing a document to generate the shard id that should contain a document with the provided parameters.- Specified by:
indexShard
in classIndexRouting
-
createId
-
createId
-
builder
-
updateShard
Description copied from class:IndexRouting
Called when updating a document to generate the shard id that should contain a document with the provided_id
and (optional)_routing
.- Specified by:
updateShard
in classIndexRouting
-
deleteShard
Description copied from class:IndexRouting
Called when deleting a document to generate the shard id that should contain a document with the provided_id
and (optional)_routing
.- Specified by:
deleteShard
in classIndexRouting
-
getShard
Description copied from class:IndexRouting
Called when getting a document to generate the shard id that should contain a document with the provided_id
and (optional)_routing
.- Specified by:
getShard
in classIndexRouting
-
checkIndexSplitAllowed
public void checkIndexSplitAllowed()Description copied from class:IndexRouting
Check if the _split index operation is allowed for an index- Overrides:
checkIndexSplitAllowed
in classIndexRouting
-
collectSearchShards
Description copied from class:IndexRouting
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 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:
collectSearchShards
in classIndexRouting
-