[GitHub] [incubator-druid] himanshug commented on a change in pull request #7729: SeekableStreamIndexTaskRunner: Lazy init of runner.
himanshug commented on a change in pull request #7729: SeekableStreamIndexTaskRunner: Lazy init of runner. URL: https://github.com/apache/incubator-druid/pull/7729#discussion_r287083342 ## File path: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTask.java ## @@ -283,13 +282,20 @@ public boolean withinMinMaxRecordTime(final InputRow row) @VisibleForTesting public Appenderator getAppenderator() { -return runner.getAppenderator(); +return getRunner().getAppenderator(); } @VisibleForTesting public SeekableStreamIndexTaskRunner getRunner() { +if (runner == null) { + synchronized (runnerInitLock) { +if (runner == null) { + runner = createTaskRunner(); +} + } +} Review comment: https://github.com/apache/incubator-druid/pull/7740 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org
[GitHub] [incubator-druid] himanshug commented on a change in pull request #7729: SeekableStreamIndexTaskRunner: Lazy init of runner.
himanshug commented on a change in pull request #7729: SeekableStreamIndexTaskRunner: Lazy init of runner. URL: https://github.com/apache/incubator-druid/pull/7729#discussion_r287083036 ## File path: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTask.java ## @@ -283,13 +282,20 @@ public boolean withinMinMaxRecordTime(final InputRow row) @VisibleForTesting public Appenderator getAppenderator() { -return runner.getAppenderator(); +return getRunner().getAppenderator(); } @VisibleForTesting public SeekableStreamIndexTaskRunner getRunner() { +if (runner == null) { + synchronized (runnerInitLock) { +if (runner == null) { + runner = createTaskRunner(); +} + } +} Review comment: that sounds nice, now I remember seeing that :) 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org
[GitHub] [incubator-druid] himanshug commented on a change in pull request #7729: SeekableStreamIndexTaskRunner: Lazy init of runner.
himanshug commented on a change in pull request #7729: SeekableStreamIndexTaskRunner: Lazy init of runner. URL: https://github.com/apache/incubator-druid/pull/7729#discussion_r286661510 ## File path: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTask.java ## @@ -283,13 +282,20 @@ public boolean withinMinMaxRecordTime(final InputRow row) @VisibleForTesting public Appenderator getAppenderator() { -return runner.getAppenderator(); +return getRunner().getAppenderator(); } @VisibleForTesting public SeekableStreamIndexTaskRunner getRunner() { +if (runner == null) { + synchronized (runnerInitLock) { +if (runner == null) { + runner = createTaskRunner(); +} + } +} Review comment: and here I thought that with all java8+ fanciness we would have a method in `AtomicReference.getOrCreate(Supplier)` but it seems this is still the way for lazy singleton. 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org