Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2183#discussion_r69153934
  
    --- Diff: 
flink-streaming-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraTupleWriteAheadSink.java
 ---
    @@ -110,11 +92,25 @@ public void close() throws Exception {
        }
     
        @Override
    -   protected void sendValues(Iterable<IN> values, long timestamp) throws 
Exception {
    -           //verify that no query failed until now
    -           if (exception != null) {
    -                   throw new Exception(exception);
    -           }
    +   protected boolean sendValues(Iterable<IN> values, long timestamp) 
throws Exception {
    +           int updatesSent = 0;
    +           final AtomicInteger updatesConfirmed = new AtomicInteger(0);
    +
    +           final AtomicContainer<Throwable> exception = new 
AtomicContainer<>();
    +
    +           FutureCallback<ResultSet> callback = new 
FutureCallback<ResultSet>() {
    +                   @Override
    +                   public void onSuccess(ResultSet resultSet) {
    +                           updatesConfirmed.incrementAndGet();
    +                   }
    +
    +                   @Override
    +                   public void onFailure(Throwable throwable) {
    +                           exception.set(throwable);
    --- End diff --
    
    Do we always want to report the last set exception or the first exception 
which occurred? In the latter case we would have to use the 
`AtomicReference#compareAndSet(null, throwable)` method. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to