KAFKA-7420: Global store surrounded by read only implementation#5865
KAFKA-7420: Global store surrounded by read only implementation#5865mjsax merged 9 commits intoapache:trunkfrom
Conversation
|
Hello, @mjsax! Can you take a look at my changes? |
|
Failure unrelated. |
1 similar comment
|
Failure unrelated. |
|
Failure unrelated. |
|
@nizhikov We stabilized a couple of test recently. Can you rebase this PR? This should help to get green builds. |
Please, tell me, what should be tested by this? |
|
Failure unrelated. |
Can you help me with this? What should be tested? |
|
We should test, that if a globalstore is returned from the context, calling any of the protected methods throws an exception. |
|
@mjsax Test added. Please, review. |
|
Tests passed |
|
@mjsax Can you take a look at my changes? |
|
Call for second review. Anyof @guozhangwang @bbejeck @vvcephei |
|
@bbejeck Thank you for the review. I've added tests for non-exception methods of |
|
Build failed with a checkstyle error |
|
Tests passed. Can we merge this PR? |
mjsax
left a comment
There was a problem hiding this comment.
I was just about to merge this PR, but I suddenly have doubts about the correctness. For global stores, we do not dictate that it must be a KeyValueStore (only for GlobalKTables) if I am not wrong.
Thus, if somebody uses a custom store, the cast into a KeyValueStore in L79 would fail and we would crash.
For library provided stores, it's only possible to use a KeyValueStore though (WindowStore and SessionStores are not supported for the provided default implementations). However, users could also use custom implementation of WindowStore or SessionStore -- the problem is not with the interfaces, but with the implementation of the or built-in window/session store.
Thus, I think, we need to check the type of the global store, and wrap it accordingly if it implements one of the three store interfaces. The store type might also so unknown, and for this case we need to return the store as-is.
Does this make sense?
It would be great to add test for all those cases.
We should wrap in read only decorator instances that implements 3 following interfaces:
@mjsax , am I understand you correctly? I will provide this fix and tests shortly. |
|
Yes. Check the type, for KeyValueStore do what the current PR does, and for Window/Session-Store apply the same pattern. |
|
@mjsax I've implement your proposal. Please, review. |
|
Tests are green. |
mjsax
left a comment
There was a problem hiding this comment.
Thanks fo the update! Couple of nits.
Call for review @guozhangwang
Nits fixed. |
|
Tests are green. |
|
Hello, @guozhangwang Please, review and my merge my PR. I have 2 approval from mjsax and bbejeck |
|
@mjsax Do I need to improve this PR? Can you approve it? |
|
Hello @mjsax No rush, I just want to know, how it's work in Kafka community Can you merge this PR by yourself? :) |
|
@nizhikov Committers can merge PRs. I would like to get a confirmation from @bbejeck because we did some mayor changes after he approved. (Or a second review from @guozhangwang @vvcephei). We want two +1 before merging. |
bbejeck
left a comment
There was a problem hiding this comment.
I took another pass over the updates LGTM
|
SGTM. There was a merge into |
Done |
Tests are green. |
|
Hello, @mjsax |
|
Hello, @mjsax Do you have a change do look at the tests results? Should I ask Bill Bejeck or Guozhang Wang to review and merge this patch? |
|
Thanks for the PR @nizhikov! Merged to Please be a little patient. We try to get back to PRs as soon as we can, but it might take couple of days. :) |
|
Thank you, @mjsax Sorry for pinging you too many times. |
Global store surrounded by read-only
KeyValueStoreimplementation.All methods that try to write into Store will throw
UnsupportedOperationExceptionCommitter Checklist (excluded from commit message)