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

refactor: Rewrite JS API to share server implementation of Flight/Barrage #5890

Merged
merged 262 commits into from
Sep 10, 2024

Conversation

niloc132
Copy link
Member

@niloc132 niloc132 commented Aug 2, 2024

Rewrites JS API Flight/Barrage to share code as much as possible with the JVM client/server implementation. Some classes are effectively copied with minor updates to function in the browser, such as WebBarrageStreamReader. Others offer alternative implementations to generic interfaces, like WebChunkReaderFactory. Finally, super source is added to handle classes in Deephaven, gRPC, and Java itself, to allow use of those types in the browser.

Notably, JS clients subscriptions are now the same implementation for both viewports and full table subscriptions. This change may degrade performance of viewports in some case relative to previous versions. To help mitigate this, in certain cases the configuration property web.flattenViewport may improve things. This lets the server instruct all clients to flatten their tables before subscribing.

Fixes #188
Fixes #186

// assert isSorted();
}

public void appendRanges(List<Range> ranges, long firstItemSubindex) {
Copy link
Member Author

Choose a reason for hiding this comment

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

That this new method is unused is one of my qualms about this change - or at least is an opportunity to improve. A binary search when we get started on add/remove/shift, bulk adding as we encounter consecutive untouched ranges, or getting the index of the last range touched so we can bulk add the rest would let us skip ~O(n) long + ops or Range.overlap (i.e. two compares) for each range. Not going to make a huge difference, compared to the work so far, but could buy us a little more breathing room.

nbauernfeind
nbauernfeind previously approved these changes Sep 9, 2024
nbauernfeind
nbauernfeind previously approved these changes Sep 9, 2024
@niloc132 niloc132 merged commit 41d5cc0 into deephaven:main Sep 10, 2024
18 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve JS API's usage of subscriptions JS API subscriptions should pass updateInterval to the server
4 participants