You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/05/15 00:43:59 UTC

[GitHub] [kafka] guozhangwang opened a new pull request #8670: MINOR: Should trigger store specific callback if it is also a listener

guozhangwang opened a new pull request #8670:
URL: https://github.com/apache/kafka/pull/8670


   The store's registered callback could also be a restore listener, in which case it should be triggered along with the user specified global listener as well.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] guozhangwang commented on pull request #8670: KAFKA-10001: Should trigger store specific callback if it is also a listener

Posted by GitBox <gi...@apache.org>.
guozhangwang commented on pull request #8670:
URL: https://github.com/apache/kafka/pull/8670#issuecomment-629322678


   @mjsax @abbccdda thanks for the review, I'm adding unit tests now. Once done I will merge it.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] mjsax commented on a change in pull request #8670: KAFKA-10001: Should trigger store specific callback if it is also a listener

Posted by GitBox <gi...@apache.org>.
mjsax commented on a change in pull request #8670:
URL: https://github.com/apache/kafka/pull/8670#discussion_r425514013



##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java
##########
@@ -522,6 +523,12 @@ private void restoreChangelog(final ChangelogMetadata changelogMetadata) {
             // do not trigger restore listener if we are processing standby tasks
             if (changelogMetadata.stateManager.taskType() == Task.TaskType.ACTIVE) {
                 try {
+                    // first trigger the store's specific listener if its registered callback is also an lister,
+                    // then trigger the user registered global listener
+                    final StateRestoreCallback restoreCallback = changelogMetadata.storeMetadata.restoreCallback();
+                    if (restoreCallback instanceof StateRestoreListener)

Review comment:
       Nit: opening/closing `{ }` are missing

##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java
##########
@@ -522,6 +523,12 @@ private void restoreChangelog(final ChangelogMetadata changelogMetadata) {
             // do not trigger restore listener if we are processing standby tasks
             if (changelogMetadata.stateManager.taskType() == Task.TaskType.ACTIVE) {
                 try {
+                    // first trigger the store's specific listener if its registered callback is also an lister,
+                    // then trigger the user registered global listener
+                    final StateRestoreCallback restoreCallback = changelogMetadata.storeMetadata.restoreCallback();

Review comment:
       Nit: we get `storeMetadata` above already (similar below) also the `if` is redundant  -- should we unify it?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] guozhangwang merged pull request #8670: KAFKA-10001: Should trigger store specific callback if it is also a listener

Posted by GitBox <gi...@apache.org>.
guozhangwang merged pull request #8670:
URL: https://github.com/apache/kafka/pull/8670


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org