You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2023/01/09 19:53:25 UTC

[GitHub] [cassandra] pauloricardomg commented on a diff in pull request #2058: [CASSANDRA-16325] Update streaming metrics incrementally

pauloricardomg commented on code in PR #2058:
URL: https://github.com/apache/cassandra/pull/2058#discussion_r1065048255


##########
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:
   I don't think `FileStreamMetricsListener` should be responsible for determining whether a stream is successful, since this class is meant to be a dumb consumer. For instance, I think we should update the number of incoming files streamed on this method `metrics.countStreamedIn(isEntireSSTable)`. The assertion `assert lastSeenBytes == totalSize;` on `onStreamSuccessful()` is just to verify that the behavior of the class `FileStreamMetricsListener` is correct, not to check whether a stream is successful or not.



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org