@Internal public abstract class ElasticsearchUpsertTableSinkBase extends Object implements UpsertStreamTableSink<Row>
UpsertStreamTableSink
.Modifier and Type | Class and Description |
---|---|
static class |
ElasticsearchUpsertTableSinkBase.ElasticsearchUpsertSinkFunction
Sink function for converting upserts into Elasticsearch
ActionRequest s. |
static class |
ElasticsearchUpsertTableSinkBase.Host
Entity for describing a host of Elasticsearch.
|
static interface |
ElasticsearchUpsertTableSinkBase.RequestFactory
For version-agnostic creating of
ActionRequest s. |
static class |
ElasticsearchUpsertTableSinkBase.SinkOption
Keys for optional parameterization of the sink.
|
Constructor and Description |
---|
ElasticsearchUpsertTableSinkBase(boolean isAppendOnly,
TableSchema schema,
List<ElasticsearchUpsertTableSinkBase.Host> hosts,
String index,
String docType,
String keyDelimiter,
String keyNullLiteral,
SerializationSchema<Row> serializationSchema,
org.elasticsearch.common.xcontent.XContentType contentType,
ActionRequestFailureHandler failureHandler,
Map<ElasticsearchUpsertTableSinkBase.SinkOption,String> sinkOptions,
ElasticsearchUpsertTableSinkBase.RequestFactory requestFactory) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getConsumedDataType, getTableSchema
public ElasticsearchUpsertTableSinkBase(boolean isAppendOnly, TableSchema schema, List<ElasticsearchUpsertTableSinkBase.Host> hosts, String index, String docType, String keyDelimiter, String keyNullLiteral, SerializationSchema<Row> serializationSchema, org.elasticsearch.common.xcontent.XContentType contentType, ActionRequestFailureHandler failureHandler, Map<ElasticsearchUpsertTableSinkBase.SinkOption,String> sinkOptions, ElasticsearchUpsertTableSinkBase.RequestFactory requestFactory)
public void setKeyFields(String[] keyNames)
UpsertStreamTableSink
Table
to write. The method is called after
TableSink.configure(String[], TypeInformation[])
.
The keys array might be empty, if the table consists of a single (updated) record. If the table does not have a key and is append-only, the keys attribute is null.
setKeyFields
in interface UpsertStreamTableSink<Row>
keyNames
- the field names of the table's keys, an empty array if the table has a single
row, and null if the table is append-only and has no key.public void setIsAppendOnly(Boolean isAppendOnly)
UpsertStreamTableSink
Table
to write is append-only or not.setIsAppendOnly
in interface UpsertStreamTableSink<Row>
isAppendOnly
- true if the table is append-only, false otherwise.public TypeInformation<Row> getRecordType()
UpsertStreamTableSink
getRecordType
in interface UpsertStreamTableSink<Row>
public DataStreamSink<?> consumeDataStream(DataStream<Tuple2<Boolean,Row>> dataStream)
StreamTableSink
DataStreamSink
. The
returned DataStreamSink
will be used to set resources for the sink operator.consumeDataStream
in interface StreamTableSink<Tuple2<Boolean,Row>>
public TypeInformation<Tuple2<Boolean,Row>> getOutputType()
getOutputType
in interface TableSink<Tuple2<Boolean,Row>>
getOutputType
in interface UpsertStreamTableSink<Row>
public String[] getFieldNames()
getFieldNames
in interface TableSink<Tuple2<Boolean,Row>>
public TypeInformation<?>[] getFieldTypes()
getFieldTypes
in interface TableSink<Tuple2<Boolean,Row>>
public TableSink<Tuple2<Boolean,Row>> configure(String[] fieldNames, TypeInformation<?>[] fieldTypes)
TableSink
TableSink
configured with the field names and types of the
table to emit.protected abstract ElasticsearchUpsertTableSinkBase copy(boolean isAppendOnly, TableSchema schema, List<ElasticsearchUpsertTableSinkBase.Host> hosts, String index, String docType, String keyDelimiter, String keyNullLiteral, SerializationSchema<Row> serializationSchema, org.elasticsearch.common.xcontent.XContentType contentType, ActionRequestFailureHandler failureHandler, Map<ElasticsearchUpsertTableSinkBase.SinkOption,String> sinkOptions, ElasticsearchUpsertTableSinkBase.RequestFactory requestFactory)
protected abstract SinkFunction<Tuple2<Boolean,Row>> createSinkFunction(List<ElasticsearchUpsertTableSinkBase.Host> hosts, ActionRequestFailureHandler failureHandler, Map<ElasticsearchUpsertTableSinkBase.SinkOption,String> sinkOptions, ElasticsearchUpsertTableSinkBase.ElasticsearchUpsertSinkFunction upsertFunction)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.