yifan-c commented on code in PR #72: URL: https://github.com/apache/cassandra-analytics/pull/72#discussion_r1711780489
########## cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/RecordWriter.java: ########## @@ -184,6 +184,10 @@ public WriteResult write(Iterator<Tuple2<DecoratedKey, Object[]>> sourceIterator Range<BigInteger> currentRange = subRanges.get(currentRangeIndex); while (dataIterator.hasNext()) { + if (streamSession != null) + { + streamSession.throwIfLastStreamFailed(); Review Comment: The `maybeSwitch` method would allow to get rid of the null check. However, I think it should only handle switching session. Throwing stream failure from the method may look confusing at the stack trace. Like, it is not error when switching session, most likely there is no session switching. I feel it is more clear to (re)throw the failure from RecordWriter#write. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org