@DefaultCoder(value=ElasticsearchIO.DocumentCoder.class) public abstract static class ElasticsearchIO.Document extends java.lang.Object implements java.io.Serializable
Constructor and Description |
---|
Document() |
Modifier and Type | Method and Description |
---|---|
static ElasticsearchIO.Document |
create() |
abstract @Nullable java.lang.String |
getBulkDirective() |
abstract java.lang.Boolean |
getHasError() |
abstract @Nullable java.lang.String |
getInputDoc() |
abstract @Nullable java.lang.String |
getResponseItemJson() |
abstract @Nullable Instant |
getTimestamp() |
ElasticsearchIO.Document |
withBulkDirective(java.lang.String bulkDirective)
Sets the bulk directive representation of an input document.
|
ElasticsearchIO.Document |
withHasError(boolean hasError)
Used to set whether or not there was an error for a given document as indicated by the
response from Elasticsearch.
|
ElasticsearchIO.Document |
withInputDoc(java.lang.String inputDoc)
Sets the input document i.e.
|
ElasticsearchIO.Document |
withResponseItemJson(java.lang.String responseItemJson)
Sets the element from Elasticsearch Bulk API response "items" pertaining to this
WriteSummary.
|
ElasticsearchIO.Document |
withTimestamp(Instant timestamp)
Sets the timestamp of the element in the PCollection, to be used in order to output
WriteSummary to the same window from which the inputDoc originated.
|
public abstract @Nullable java.lang.String getInputDoc()
public abstract @Nullable java.lang.String getBulkDirective()
public abstract java.lang.Boolean getHasError()
public abstract @Nullable java.lang.String getResponseItemJson()
public abstract @Nullable Instant getTimestamp()
public static ElasticsearchIO.Document create()
public ElasticsearchIO.Document withInputDoc(java.lang.String inputDoc)
ElasticsearchIO.Write
or ElasticsearchIO.DocToBulk
inputDoc
- Serialized json input document destined to end up in Elasticsearch.public ElasticsearchIO.Document withBulkDirective(java.lang.String bulkDirective)
bulkDirective
- Serialized new-line delimited json bulk API information.public ElasticsearchIO.Document withResponseItemJson(java.lang.String responseItemJson)
responseItemJson
- The Elasticsearch Bulk API response.public ElasticsearchIO.Document withHasError(boolean hasError)
ElasticsearchIO.Write.withAllowableResponseErrors(java.util.Set<java.lang.String>)
errors which are allowed will have a false value for hasError for their respective
WriteSummary.hasError
- Whether or not Elasticsearch returned an error when persisting a bulk
directive.public ElasticsearchIO.Document withTimestamp(Instant timestamp)
timestamp
- The timestamp with which the WriteSummary will be output.