public abstract static class ElasticsearchIO.Write extends PTransform<PCollection<java.lang.String>,PDone>
PTransform
writing data to Elasticsearch.Modifier and Type | Class and Description |
---|---|
static interface |
ElasticsearchIO.Write.FieldValueExtractFn
Interface allowing a specific field value to be returned from a parsed JSON document.
|
name
Constructor and Description |
---|
Write() |
Modifier and Type | Method and Description |
---|---|
PDone |
expand(PCollection<java.lang.String> input)
Override this method to specify how this
PTransform should be expanded
on the given InputT . |
ElasticsearchIO.Write |
withConnectionConfiguration(ElasticsearchIO.ConnectionConfiguration connectionConfiguration)
Provide the Elasticsearch connection configuration object.
|
ElasticsearchIO.Write |
withIdFn(ElasticsearchIO.Write.FieldValueExtractFn idFn)
Provide a function to extract the id from the document.
|
ElasticsearchIO.Write |
withIndexFn(ElasticsearchIO.Write.FieldValueExtractFn indexFn)
Provide a function to extract the target index from the document allowing for dynamic
document routing.
|
ElasticsearchIO.Write |
withMaxBatchSize(long batchSize)
Provide a maximum size in number of documents for the batch see bulk API
(https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-bulk.html).
|
ElasticsearchIO.Write |
withMaxBatchSizeBytes(long batchSizeBytes)
Provide a maximum size in bytes for the batch see bulk API
(https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-bulk.html).
|
ElasticsearchIO.Write |
withTypeFn(ElasticsearchIO.Write.FieldValueExtractFn typeFn)
Provide a function to extract the target type from the document allowing for dynamic document
routing.
|
ElasticsearchIO.Write |
withUsePartialUpdate(boolean usePartialUpdate)
Provide an instruction to control whether partial updates or inserts (default) are issued to
Elasticsearch.
|
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validate
public ElasticsearchIO.Write withConnectionConfiguration(ElasticsearchIO.ConnectionConfiguration connectionConfiguration)
connectionConfiguration
- the Elasticsearch ElasticsearchIO.ConnectionConfiguration
objectElasticsearchIO.Write
with connection configuration setpublic ElasticsearchIO.Write withMaxBatchSize(long batchSize)
batchSize
- maximum batch size in number of documentsElasticsearchIO.Write
with connection batch size setpublic ElasticsearchIO.Write withMaxBatchSizeBytes(long batchSizeBytes)
batchSizeBytes
- maximum batch size in bytesElasticsearchIO.Write
with connection batch size in bytes setpublic ElasticsearchIO.Write withIdFn(ElasticsearchIO.Write.FieldValueExtractFn idFn)
idFn
- to extract the document IDElasticsearchIO.Write
with the function setpublic ElasticsearchIO.Write withIndexFn(ElasticsearchIO.Write.FieldValueExtractFn indexFn)
indexFn
- to extract the destination index fromElasticsearchIO.Write
with the function setpublic ElasticsearchIO.Write withTypeFn(ElasticsearchIO.Write.FieldValueExtractFn typeFn)
typeFn
- to extract the destination index fromElasticsearchIO.Write
with the function setpublic ElasticsearchIO.Write withUsePartialUpdate(boolean usePartialUpdate)
usePartialUpdate
- set to true to issue partial updatesElasticsearchIO.Write
with the partial update control setpublic PDone expand(PCollection<java.lang.String> input)
PTransform
PTransform
should be expanded
on the given InputT
.
NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to the InputT
using the apply
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).
expand
in class PTransform<PCollection<java.lang.String>,PDone>