-
Notifications
You must be signed in to change notification settings - Fork 132
chore(x-goog-spanner-request-id): add SessionImpl.getChannel() and Options.RequestIdOption.(equals, hashCode) #3900
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
chore(x-goog-spanner-request-id): add SessionImpl.getChannel() and Options.RequestIdOption.(equals, hashCode) #3900
Conversation
f1c4977
to
6da90d0
Compare
6da90d0
to
c822be3
Compare
4f13b14
to
21f755e
Compare
21f755e
to
cad7fa9
Compare
…tions.RequestIdOption.(equals, hashCode) Implements channelId retrieval that'll then be used to plumb into x-goog-spanner-request-id's channel. Also implements Options.RequestIdOption.(equals, hashCode) Fixes googleapis#3899 Implement Options.RequestIdOption.(equals, hashCode)
e96ae47
to
6e65c3e
Compare
if (this.reqId == null || other.reqId == null) { | ||
return this.reqId == null && other.reqId == null; | ||
} | ||
return this.reqId.equals(other.reqId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tip for next time (just leave as-is for now);Java has a utility method for this:
java.util.Objects.equals(this.reqId, other.reqId);
@@ -464,17 +464,15 @@ public AsyncTransactionManagerImpl transactionManagerAsync(TransactionOption... | |||
|
|||
@Override | |||
public ApiFuture<Empty> asyncClose() { | |||
XGoogSpannerRequestId reqId = | |||
this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 0); | |||
XGoogSpannerRequestId reqId = this.getRequestIdCreator().nextRequestId(this.getChannel(), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the initial attempt 0 here and in the close()
method, but 1 in beginTransactionAsync()
?
if (getIsMultiplexed()) { | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that this means that we will be getting the channel that is being used in a different way for multiplexed sessions, and that this method is only intended for actual use with regular sessions.
…s prior code review suggestions This change propagates the associated request-id into encountered exceptions and also addresses some code review questions from PR googleapis#3900. While here added some updates for AbstractReadContext.java and ResumableStreamIterator.java to set grounds for much smaller PRs in which we shall wholesomely test the changes. Curved out of PR googleapis#3898 and PR googleapis#3915
…s prior code review suggestions This change propagates the associated request-id into encountered exceptions and also addresses some code review questions from PR googleapis#3900. While here added some updates for AbstractReadContext.java and ResumableStreamIterator.java to set grounds for much smaller PRs in which we shall wholesomely test the changes. Curved out of PR googleapis#3898 and PR googleapis#3915
…s prior code review suggestions This change propagates the associated request-id into encountered exceptions and also addresses some code review questions from PR googleapis#3900. While here added some updates for AbstractReadContext.java and ResumableStreamIterator.java to set grounds for much smaller PRs in which we shall wholesomely test the changes. Curved out of PR googleapis#3898 and PR googleapis#3915
…s prior code review suggestions This change propagates the associated request-id into encountered exceptions and also addresses some code review questions from PR googleapis#3900. While here added some updates for AbstractReadContext.java and ResumableStreamIterator.java to set grounds for much smaller PRs in which we shall wholesomely test the changes. Curved out of PR googleapis#3898 and PR googleapis#3915
…s prior code review suggestions This change propagates the associated request-id into encountered exceptions and also addresses some code review questions from PR googleapis#3900. While here added some updates for AbstractReadContext.java and ResumableStreamIterator.java to set grounds for much smaller PRs in which we shall wholesomely test the changes. Curved out of PR googleapis#3898 and PR googleapis#3915
…s prior code review suggestions (#3922) * chore(x-goog-spanner-request-id): propagate reqId into exceptions plus prior code review suggestions This change propagates the associated request-id into encountered exceptions and also addresses some code review questions from PR #3900. While here added some updates for AbstractReadContext.java and ResumableStreamIterator.java to set grounds for much smaller PRs in which we shall wholesomely test the changes. Curved out of PR #3898 and PR #3915 * Update tests with session.getRequestIdCreator * More plumbing * Update tests * Deal with the multiplex-session .getOptions null returns in getChannel * Correct array copy
Implements channelId retrieval that'll then be used to plumb into x-goog-spanner-request-id's channel.
Fixes #3899