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 01:21:06 UTC

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

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