IN
- public abstract static class CassandraSink.CassandraSinkBuilder<IN> extends Object
CassandraSink
.Modifier and Type | Field and Description |
---|---|
protected ClusterBuilder |
builder |
protected CheckpointCommitter |
committer |
protected DataStream<IN> |
input |
protected boolean |
isWriteAheadLogEnabled |
protected MapperOptions |
mapperOptions |
protected String |
query |
protected TypeSerializer<IN> |
serializer |
protected TypeInformation<IN> |
typeInfo |
Constructor and Description |
---|
CassandraSinkBuilder(DataStream<IN> input,
TypeInformation<IN> typeInfo,
TypeSerializer<IN> serializer) |
Modifier and Type | Method and Description |
---|---|
CassandraSink<IN> |
build()
Finalizes the configuration of this sink.
|
protected abstract CassandraSink<IN> |
createSink() |
protected abstract CassandraSink<IN> |
createWriteAheadSink() |
CassandraSink.CassandraSinkBuilder<IN> |
enableWriteAheadLog()
Enables the write-ahead log, which allows exactly-once processing for non-deterministic algorithms that use
idempotent updates.
|
CassandraSink.CassandraSinkBuilder<IN> |
enableWriteAheadLog(CheckpointCommitter committer)
Enables the write-ahead log, which allows exactly-once processing for non-deterministic algorithms that use
idempotent updates.
|
protected void |
sanityCheck() |
CassandraSink.CassandraSinkBuilder<IN> |
setClusterBuilder(ClusterBuilder builder)
Sets the ClusterBuilder for this sink.
|
CassandraSink.CassandraSinkBuilder<IN> |
setHost(String host)
Sets the cassandra host to connect to.
|
CassandraSink.CassandraSinkBuilder<IN> |
setHost(String host,
int port)
Sets the cassandra host/port to connect to.
|
CassandraSink.CassandraSinkBuilder<IN> |
setMapperOptions(MapperOptions options)
Sets the mapper options for this sink.
|
CassandraSink.CassandraSinkBuilder<IN> |
setQuery(String query)
Sets the query that is to be executed for every record.
|
protected final DataStream<IN> input
protected final TypeSerializer<IN> serializer
protected final TypeInformation<IN> typeInfo
protected ClusterBuilder builder
protected MapperOptions mapperOptions
protected String query
protected CheckpointCommitter committer
protected boolean isWriteAheadLogEnabled
public CassandraSinkBuilder(DataStream<IN> input, TypeInformation<IN> typeInfo, TypeSerializer<IN> serializer)
public CassandraSink.CassandraSinkBuilder<IN> setQuery(String query)
query
- query to usepublic CassandraSink.CassandraSinkBuilder<IN> setHost(String host)
host
- host to connect topublic CassandraSink.CassandraSinkBuilder<IN> setHost(String host, int port)
host
- host to connect toport
- port to connect topublic CassandraSink.CassandraSinkBuilder<IN> setClusterBuilder(ClusterBuilder builder)
builder
- ClusterBuilder to configure the connection to cassandrapublic CassandraSink.CassandraSinkBuilder<IN> enableWriteAheadLog()
public CassandraSink.CassandraSinkBuilder<IN> enableWriteAheadLog(CheckpointCommitter committer)
committer
- CheckpointCommitter, that stores information about completed checkpoints in an external
resource. By default this information is stored within a separate table within Cassandra.public CassandraSink.CassandraSinkBuilder<IN> setMapperOptions(MapperOptions options)
Mapper
when writing POJOs.
This call has no effect if the input DataStream
for this sink does not contain POJOs.
options
- MapperOptions, that return an array of options that are used to configure the DataStax mapper.public CassandraSink<IN> build() throws Exception
Exception
protected abstract CassandraSink<IN> createSink() throws Exception
Exception
protected abstract CassandraSink<IN> createWriteAheadSink() throws Exception
Exception
protected void sanityCheck()
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.