Class ElasticsearchIO.Write
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<String>,PCollectionTuple>
org.apache.beam.sdk.io.elasticsearch.ElasticsearchIO.Write
- All Implemented Interfaces:
Serializable
,HasDisplayData
- Enclosing class:
ElasticsearchIO
A
PTransform
writing data to Elasticsearch.
This PTransform
acts as a convenience wrapper for doing both document to bulk API
serialization as well as batching those Bulk API entities and writing them to an Elasticsearch
cluster. This class is effectively a thin proxy for DocToBulk->BulkIO all-in-one for
convenience and backward compatibility.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TupleTag
<ElasticsearchIO.Document> static final TupleTag
<ElasticsearchIO.Document> Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexpand
(PCollection<String> input) Override this method to specify how thisPTransform
should be expanded on the givenInputT
.withAllowableResponseErrors
(@Nullable Set<String> allowableResponseErrors) withAppendOnly
(boolean appendOnly) withBackendVersion
(int backendVersion) withConnectionConfiguration
(ElasticsearchIO.ConnectionConfiguration connectionConfiguration) withDocVersionFn
(ElasticsearchIO.Write.FieldValueExtractFn docVersionFn) withDocVersionType
(String docVersionType) withIgnoreVersionConflicts
(boolean ignoreVersionConflicts) withMaxBatchSize
(long batchSize) withMaxBatchSizeBytes
(long batchSizeBytes) withMaxBufferingDuration
(Duration maxBufferingDuration) withMaxParallelRequests
(int maxParallelRequests) withMaxParallelRequestsPerWindow
(int maxParallelRequestsPerWindow) Deprecated.withRetryConfiguration
(ElasticsearchIO.RetryConfiguration retryConfiguration) withThrowWriteErrors
(boolean throwWriteErrors) withUpsertScript
(String source) withUsePartialUpdate
(boolean usePartialUpdate) withUseStatefulBatches
(boolean useStatefulBatches) Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Field Details
-
SUCCESSFUL_WRITES
-
FAILED_WRITES
-
-
Constructor Details
-
Write
public Write()
-
-
Method Details
-
getDocToBulk
-
getBulkIO
-
withIdFn
-
withIndexFn
-
withRoutingFn
-
withTypeFn
-
withDocVersionFn
public ElasticsearchIO.Write withDocVersionFn(ElasticsearchIO.Write.FieldValueExtractFn docVersionFn) -
withDocVersionType
-
withUsePartialUpdate
-
withAppendOnly
-
withUpsertScript
-
withBackendVersion
-
withIsDeleteFn
public ElasticsearchIO.Write withIsDeleteFn(ElasticsearchIO.Write.BooleanFieldValueExtractFn isDeleteFn) -
withConnectionConfiguration
public ElasticsearchIO.Write withConnectionConfiguration(ElasticsearchIO.ConnectionConfiguration connectionConfiguration) -
withMaxBatchSize
-
withMaxBatchSizeBytes
-
withRetryConfiguration
public ElasticsearchIO.Write withRetryConfiguration(ElasticsearchIO.RetryConfiguration retryConfiguration) -
withIgnoreVersionConflicts
-
withUseStatefulBatches
-
withMaxBufferingDuration
-
withMaxParallelRequestsPerWindow
@Deprecated public ElasticsearchIO.Write withMaxParallelRequestsPerWindow(int maxParallelRequestsPerWindow) Deprecated.usewithMaxParallelRequests(int)
instead -
withMaxParallelRequests
-
withAllowableResponseErrors
public ElasticsearchIO.Write withAllowableResponseErrors(@Nullable Set<String> allowableResponseErrors) -
withThrowWriteErrors
-
expand
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
method.Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
- Specified by:
expand
in classPTransform<PCollection<String>,
PCollectionTuple>
-
withMaxParallelRequests(int)
instead