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

feat: Adds ability to bypass cache for pull queries #6891

Merged
merged 23 commits into from
Feb 11, 2021

Conversation

cprasad1
Copy link
Member

@cprasad1 cprasad1 commented Jan 25, 2021

Description

Adds ability to bypass cache for pull queries

Testing done

Updated existing unit tests

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@cprasad1 cprasad1 requested a review from a team as a code owner January 25, 2021 04:33
@ghost
Copy link

ghost commented Jan 25, 2021

@confluentinc It looks like @cprasad1 just signed our Contributor License Agreement. 👍

Always at your service,

clabot

@cprasad1 cprasad1 marked this pull request as draft January 25, 2021 04:33
@cprasad1 cprasad1 marked this pull request as ready for review January 26, 2021 20:12
Copy link
Member

@AlanConfluent AlanConfluent left a comment

Choose a reason for hiding this comment

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

Can you add additional tests to WindowStoreCacheBypassTest and SessionStoreCacheBypassTest?

Objects.requireNonNull(keyTo, "upper key can't be null");
final List<ReadOnlyWindowStore<GenericKey, ValueAndTimestamp<GenericRow>>> stores
= getStores(store);
for (final ReadOnlyWindowStore<GenericKey, ValueAndTimestamp<GenericRow>> windowStore :stores) {
Copy link
Member

Choose a reason for hiding this comment

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

You can probably put this for loop in a method that takes a lambda:

findFirstNonEmptyIterator(... stores, Function<ReadOnlyWindowStore<GenericKey, ValueAndTimestamp<GenericRow>>, KeyValueIterator<Windowed<GenericKey>> func) {
  for (...) {
  
  }
}

You might have to make a generic parameter of the method if you want to handle the WindowStoreIterator as well, but it could simplify the code a bit more.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have tried to implement that, but it required a bit of type casting and I am nervous about that

Copy link
Member

@vvcephei vvcephei left a comment

Choose a reason for hiding this comment

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

Thanks, @cprasad1 !

Overall, this PR LGTM. Once you've addressed @AlanConfluent 's feedback, I'm ok to merge.

Copy link
Member

@AlanConfluent AlanConfluent left a comment

Choose a reason for hiding this comment

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

Nice, LGTM

@cprasad1 cprasad1 merged commit 4b3bc96 into confluentinc:master Feb 11, 2021
@cprasad1 cprasad1 deleted the cache_bypass_scan branch February 11, 2021 02:21
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.

3 participants