ASF GitHub Bot commented on FLINK-9165:

Github user zentol commented on the issue:

    Even then `invoke(Collection<IN>)` would never be called. `IN` is always 
the type of the `DataStream` the sink is applied on, and it can't be 
`Collection<IN>` as you would have an infinitely recursive type.
    You need to create a subclass that extends 
`CassandraSinkBase<Collection<SOMETYPE>>` which can then be applied to 
`DataStream<Collection<SOMETYPE>>`, and that you can already do. Note that it 
is rather unusual for the stream to contain collections, so I doubt we would be 
adding much value here.
    If instead you you want a sink of type `IN` that buffers elements and sends 
them in batches you can use the `CassandraWriteAheadSink`.
    Finally, do note that cassandra batches are a far cry from transactions. 
IIRC the guarantees work as such that either the batch completes successfully 
in which case all element are written, or it fails in which case _some_ records 
may have been written.

> Improve CassandraSinkBase to send Collections
> ---------------------------------------------
>                 Key: FLINK-9165
>                 URL: https://issues.apache.org/jira/browse/FLINK-9165
>             Project: Flink
>          Issue Type: Improvement
>          Components: Cassandra Connector
>    Affects Versions: 1.4.2
>            Reporter: Christopher Hughes
>            Priority: Minor
>              Labels: easyfix, feature
> The CassandraSinkBase can currently only handle individual objects.  I 
> propose overloading the `send(IN value)` method to include 
> `send(Collection<IN> value)`. 

This message was sent by Atlassian JIRA

Reply via email to