java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.LegacyActionRequest
org.elasticsearch.action.bulk.BulkRequest
org.elasticsearch.action.bulk.SimulateBulkRequest
- All Implemented Interfaces:
org.apache.lucene.util.Accountable,CompositeIndicesRequest,WriteRequest<BulkRequest>,Writeable,RefCounted,TaskAwareRequest,RawIndexingDataTransportRequest
This extends BulkRequest with support for providing substitute pipeline definitions, component template definitions, and index template
substitutions. In a user request, the substitutions will look something like this:
"pipeline_substitutions": {
"my-pipeline-1": {
"processors": [
{
"set": {
"field": "my-new-boolean-field",
"value": true
}
}
]
},
"my-pipeline-2": {
"processors": [
{
"set": {
"field": "my-new-boolean-field",
"value": true
},
"rename": {
"field": "old_field",
"target_field": "new field"
}
}
]
}
},
"component_template_substitutions": {
"my-template-1": {
"template": {
"settings": {
"number_of_shards": 1
},
"mappings": {
"_source": {
"enabled": false
},
"properties": {
"host_name": {
"type": "keyword"
},
"created_at": {
"type": "date",
"format": "EEE MMM dd HH:mm:ss Z yyyy"
}
}
}
}
}
},
"index_template_substitutions": {
"my-index-template-1": {
"template": {
"index_patterns": ["foo*", "bar*"]
"composed_of": [
"component-template-1",
"component-template-2"
]
}
}
},
"mapping_addition": {
"dynamic": "strict",
"properties": {
"foo": {
"type": "keyword"
}
}
The pipelineSubstitutions Map held by this class is intended to be the result of XContentHelper.convertToMap(). The top-level keys
are the pipelineIds ("my-pipeline-1" and "my-pipeline-2" in the example above). The values are the Maps of "processors" to the List of
processor definitions.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>Nested classes/interfaces inherited from interface org.elasticsearch.action.support.WriteRequest
WriteRequest.RefreshPolicy -
Field Summary
Fields inherited from class org.elasticsearch.action.bulk.BulkRequest
timeoutFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLEFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this is a request for a simulation rather than a real bulk request.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.bulk.BulkRequest
add, add, add, add, add, add, add, add, add, add, add, estimatedSizeInBytes, getDescription, getIndices, getRefreshPolicy, includeSourceOnError, includeSourceOnError, incrementalState, incrementalState, numberOfActions, pipeline, pipeline, ramBytesUsed, requests, requireAlias, requireAlias, requireDataStream, requireDataStream, routing, routing, setRefreshPolicy, timeout, timeout, validate, waitForActiveShards, waitForActiveShards, waitForActiveShardsMethods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, getRequestId, setParentTask, setRequestId, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResourcesMethods inherited from interface org.elasticsearch.transport.RawIndexingDataTransportRequest
isRawIndexingDataMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, setParentTaskMethods inherited from interface org.elasticsearch.action.support.WriteRequest
setRefreshPolicy
-
Constructor Details
-
SimulateBulkRequest
public SimulateBulkRequest(Map<String, Map<String, Object>> pipelineSubstitutions, Map<String, Map<String, Object>> componentTemplateSubstitutions, Map<String, Map<String, Object>> indexTemplateSubstitutions, Map<String, Object> mappingAddition) - Parameters:
pipelineSubstitutions- The pipeline definitions that are to be used in place of any pre-existing pipeline definitions with the same pipelineId. The key of the map is the pipelineId, and the value the pipeline definition as parsed by XContentHelper.convertToMap().componentTemplateSubstitutions- The component template definitions that are to be used in place of any pre-existing component template definitions with the same name.indexTemplateSubstitutions- The index template definitions that are to be used in place of any pre-existing index template definitions with the same name.mappingAddition- A mapping that will be merged into the final index's mapping for mapping validation
-
SimulateBulkRequest
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classBulkRequest- Throws:
IOException
-
getPipelineSubstitutions
-
isSimulated
public boolean isSimulated()Description copied from class:BulkRequestReturns true if this is a request for a simulation rather than a real bulk request.- Overrides:
isSimulatedin classBulkRequest- Returns:
- true if this is a simulated bulk request
-
getComponentTemplateSubstitutions
- Overrides:
getComponentTemplateSubstitutionsin classBulkRequest
-
getIndexTemplateSubstitutions
- Overrides:
getIndexTemplateSubstitutionsin classBulkRequest
-
getMappingAddition
-
shallowClone
- Overrides:
shallowClonein classBulkRequest
-