Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra 15665 trunk 15666 #586

Closed

Conversation

jasonstack
Copy link
Contributor

@jasonstack jasonstack commented May 9, 2020

Copy link
Contributor

@blerer blerer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch looks good to me. I just put some minor comments.

*/
public class StreamMessageHeader
{
public static FileMessageHeaderSerializer serializer = new FileMessageHeaderSerializer();

public final TableId tableId;
public UUID planId;
// it tells us if the file was sent by a follower
public final boolean isFollower;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the level of the message isFollower is a confusing name. sendByFollower or fromFollower would make more sense to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to sendByFollower, the new name is clearer in the context of stream message.

@@ -176,17 +176,10 @@ public void removeNotificationListener(NotificationListener listener, Notificati
return notifier.getNotificationInfo();
}

public StreamSession findSession(InetAddressAndPort peer, UUID planId, int sessionIndex)
public StreamSession findSession(InetAddressAndPort peer, UUID planId, int sessionIndex, boolean sentByFollower)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument name 'sentByFollower' makes sense in the context of the IncomingStreamMessage but not so much in the context of this method. In my opinion we should either rename the parameter to something like searchInitiatorSessions or add some comment to explain the logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 updated to searchInitiatorSessions

Comment on lines 231 to 232
if (streamSession == null)
throw new IllegalStateException(createLogTag(null, channel) + " no session found for message " + message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my understanding, calling getOrCreateSession on StreamInitMessage or IncomingStreamMessage is guaranty to return a StreamSession and calling getOrCreateSession on another type of message would throw an UnsupportedOperationException. By consequence, it seems that this null check is useless. Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it shouldn't be null. I will remove it.

@jasonstack jasonstack force-pushed the CASSANDRA-15665-trunk-15666 branch from 6265a7f to 2928a88 Compare May 28, 2020 14:42
@jasonstack
Copy link
Contributor Author

rebased and applied review feedback. CI Running: https://circleci.com/workflow-run/947320b4-3c52-4113-91ab-36d622a45e23

@jasonstack jasonstack closed this Jun 23, 2020
blambov pushed a commit to blambov/cassandra that referenced this pull request Nov 24, 2022
adelapena pushed a commit to adelapena/cassandra that referenced this pull request Sep 26, 2023
(cherry picked from commit c9f0cc4)
(cherry picked from commit ad17429)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants