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

The completion stream RPC defaults to the ledger end as offset #1961

Merged
merged 4 commits into from
Jul 2, 2019

Conversation

stefanobaghino-da
Copy link
Contributor

Fixes #1913

Relevant changes are propagated to the Java bindings (including
deprecating a method that would now return a nullable ledger end).

Pull Request Checklist

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

Copy link
Contributor

@gabor-aranyossy gabor-aranyossy left a comment

Choose a reason for hiding this comment

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

looks good, I had few comments

private[this] val completionStreamDefaultOffset =
LedgerOffset.of(LedgerOffset.Value.Boundary(LedgerOffset.LedgerBoundary.LEDGER_END))

private def fillInWithDefaults(request: CompletionStreamRequest): CompletionStreamRequest = {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpicking: this method could live on the class itself, does not have to be "static". Also, you can drop two {a and '}'s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I usually favor "static" methods unless I'm relying on a specific object's state. I can make it an instance method if you think it belongs there. Do you have a specific reason why you'd prefer it to be an instance method?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just so it's close to where it's used. I tend not put too many functions on objects, even if they are stateless, unless they need to have wider visibility. Putting them on the class instance has no runtime penalty and results in better code cohesion in my opinion.

This is a matter of taste I think, don't change it if you don't agree.

stefanobaghino-da added a commit that referenced this pull request Jul 1, 2019
- ignore command creation results
(#1961 (comment))
- avoid re-connecting to the client for every command
(#1961 (comment))
- move offset field optionality to domain object
(#1961 (comment))
@stefanobaghino-da
Copy link
Contributor Author

stefanobaghino-da commented Jul 1, 2019

@gerolf-da Your review should be addressed by 1f8fae9 a331839

The same commit also covers two of @gaboraranyossy-da's comments but a couple are still open. One in particular may benefit from some extra attention.

Fixes #1913

Relevant changes are propagated to the Java bindings (including
deprecating a method that would now return a nullable ledger end).
- ignore command creation results
(#1961 (comment))
- avoid re-connecting to the client for every command
(#1961 (comment))
- move offset field optionality to domain object
(#1961 (comment))
@stefanobaghino-da stefanobaghino-da force-pushed the ledger-api-completion-stream-offset-optional branch from 1f8fae9 to a331839 Compare July 1, 2019 17:10
@stefanobaghino-da
Copy link
Contributor Author

I don't know why but this keeps on failing while running the formatting check. Locally everything seems to be in order. Rebasing on the latest master. didn't solve the issue.

Copy link
Contributor

@gabor-aranyossy gabor-aranyossy left a comment

Choose a reason for hiding this comment

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

Approving, but I'd recommend getting to the bottom of the issue of using Sink.head

@stefanobaghino-da
Copy link
Contributor Author

@gaboraranyossy-da Thanks, the tests have been fixed by e8e4b5c

@mergify mergify bot merged commit 4774e75 into master Jul 2, 2019
@mergify mergify bot deleted the ledger-api-completion-stream-offset-optional branch July 2, 2019 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

completionStream rpc rejects requests without an offset
4 participants