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

C++ client: process Barrage shifts properly #5285

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

kosak
Copy link
Contributor

@kosak kosak commented Mar 22, 2024

This PR changes three things.

  1. Before this PR, the code in SpaceMapper::ApplyShift (space_mapper.cc) was simply wrong. When Barrage communicates a shift in the range [begin, end), the old code would remove [begin, end) from the rowset and then add the whole range [begin+offset, end+offset) to the rowset. The correct behavior is to only add the subset of the range that already existed in the rowset.
  2. Add more range checks to immer_column_source.h
  3. Rewrite immer_column_source.h to do data copying separately from null handling and potentially be a little more readable.
  4. Rewrite the ostream operator for RowSequence so that it emits ranges rather than individual keys, potentially making the output smaller.

@kosak kosak requested a review from jcferretti March 22, 2024 21:45
@kosak kosak self-assigned this Mar 22, 2024
@kosak kosak added NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. labels Mar 22, 2024
immer::for_each_chunk(src_beginp, src_endp, copy_nulls_inner);
};
rows.ForEachInterval(copy_nulls_outer);
} else {
Copy link
Member

Choose a reason for hiding this comment

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

Since the function is about to return right after the else anyway, can you consider short-circuiting this else by returning in the body of the if above, and then removing the else?

Looking at the actual file is going to be easier than trying to follow the logic in the diff, but in either case, I find that is easier for me to read code when you allow me to drop stacks of context earlier.

Copy link
Member

Choose a reason for hiding this comment

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

We discussed on slack, it is an if constexpr so my comment doesn't apply/work.

sep = ", ";
}
s << '[' << start << ',' << end << ')';
Copy link
Member

Choose a reason for hiding this comment

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

That is an opening brace and a close parens... is that intentional?

Copy link
Member

Choose a reason for hiding this comment

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

I guess it is because is an open interval, nevermind...

@kosak kosak merged commit dcfc794 into deephaven:main Mar 22, 2024
16 of 19 checks passed
@kosak kosak deleted the kosak_barrage-shifts branch March 22, 2024 23:09
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants