@Internal public class HBaseUpsertTableSink extends Object implements UpsertStreamTableSink<Row>
UpsertStreamTableSink
for HBase.Constructor and Description |
---|
HBaseUpsertTableSink(HBaseTableSchema hbaseTableSchema,
HBaseOptions hbaseOptions,
HBaseWriteOptions writeOptions) |
Modifier and Type | Method and Description |
---|---|
TableSink<Tuple2<Boolean,Row>> |
configure(String[] fieldNames,
TypeInformation<?>[] fieldTypes)
Returns a copy of this
TableSink configured with the field names and types of the
table to emit. |
DataStreamSink<?> |
consumeDataStream(DataStream<Tuple2<Boolean,Row>> dataStream)
Consumes the DataStream and return the sink transformation
DataStreamSink . |
HBaseOptions |
getHBaseOptions() |
HBaseTableSchema |
getHBaseTableSchema() |
TypeInformation<Row> |
getRecordType()
Returns the requested record type.
|
TableSchema |
getTableSchema()
Returns the schema of the consumed table.
|
HBaseWriteOptions |
getWriteOptions() |
void |
setIsAppendOnly(Boolean isAppendOnly)
Specifies whether the
Table to write is append-only or not. |
void |
setKeyFields(String[] keys)
Configures the unique key fields of the
Table to write. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOutputType
getConsumedDataType, getFieldNames, getFieldTypes
public HBaseUpsertTableSink(HBaseTableSchema hbaseTableSchema, HBaseOptions hbaseOptions, HBaseWriteOptions writeOptions)
public void setKeyFields(String[] keys)
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>
keys
- 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 TableSchema getTableSchema()
TableSink
getTableSchema
in interface TableSink<Tuple2<Boolean,Row>>
TableSchema
of the consumed table.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 TableSink<Tuple2<Boolean,Row>> configure(String[] fieldNames, TypeInformation<?>[] fieldTypes)
TableSink
TableSink
configured with the field names and types of the
table to emit.@VisibleForTesting public HBaseTableSchema getHBaseTableSchema()
@VisibleForTesting public HBaseOptions getHBaseOptions()
@VisibleForTesting public HBaseWriteOptions getWriteOptions()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.