viirya commented on a change in pull request #23521: [SPARK-26604][CORE] Clean
up channel registration for StreamManager
URL: https://github.com/apache/spark/pull/23521#discussion_r247852225
##########
File path:
common/network-common/src/main/java/org/apache/spark/network/server/OneForOneStreamManager.java
##########
@@ -195,11 +190,19 @@ public long chunksBeingTransferred() {
*
* If an app ID is provided, only callers who've authenticated with the
given app ID will be
* allowed to fetch from this stream.
+ *
+ * This method also associates the stream with a single client connection,
which is guaranteed
+ * to be the only reader of the stream. Once the connection is closed, the
stream will never
+ * be used again, enabling cleanup by `connectionTerminated`.
*/
- public long registerStream(String appId, Iterator<ManagedBuffer> buffers) {
+ public long registerStream(String appId, Iterator<ManagedBuffer> buffers,
Channel channel) {
long myStreamId = nextStreamId.getAndIncrement();
- streams.put(myStreamId, new StreamState(appId, buffers));
+ streams.put(myStreamId, new StreamState(appId, buffers, channel));
return myStreamId;
}
+ @VisibleForTesting
+ public int streamStateSize() {
Review comment:
Changed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]