smiklosovic commented on code in PR #2058:
URL: https://github.com/apache/cassandra/pull/2058#discussion_r1063662721
##########
src/java/org/apache/cassandra/db/streaming/CassandraOutgoingFile.java:
##########
@@ -172,10 +174,11 @@ public void write(StreamSession session,
StreamingDataOutputPlus out, int versio
out.flush();
CassandraStreamWriter writer = header.isCompressed() ?
- new
CassandraCompressedStreamWriter(sstable, header, session) :
- new CassandraStreamWriter(sstable,
header, session);
+ new
CassandraCompressedStreamWriter(sstable, header, session,
fileStreamMetricsListener) :
+ new CassandraStreamWriter(sstable,
header, session, fileStreamMetricsListener);
writer.write(out);
}
+ fileStreamMetricsListener.onStreamSuccessful();
Review Comment:
what if `onStreamSuccessful` returned boolean so it would be called
`isStreamSuccessful` and if it is not it would throw an exception? This method
already throws `IOException` so it seems to be quite logical to me that if
streaming was not successful we would throw as well. Right now we are doing
`assert` in it which can throw `AssertionError` but that is not subclass of
`IOException`.
Another option is to throw IOException directly from `onStreamSuccessful`
with accompanying error message.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]