You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/05/22 20:30:50 UTC

[GitHub] [incubator-druid] clintropolis commented on a change in pull request #7729: SeekableStreamIndexTaskRunner: Lazy init of runner.

clintropolis commented on a change in pull request #7729: SeekableStreamIndexTaskRunner: Lazy init of runner.
URL: https://github.com/apache/incubator-druid/pull/7729#discussion_r286673679
 
 

 ##########
 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<PartitionIdType, SequenceOffsetType> getRunner()
   {
+    if (runner == null) {
+      synchronized (runnerInitLock) {
+        if (runner == null) {
+          runner = createTaskRunner();
+        }
+      }
+    }
 
 Review comment:
   guava has `Suppliers.memoize` that does this, we use it in a couple of places already

----------------------------------------------------------------
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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org