kfaraz commented on code in PR #14507:
URL: https://github.com/apache/druid/pull/14507#discussion_r1277080871
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java:
##########
@@ -1199,6 +1201,15 @@ public InputSource getInputSource()
return inputSource;
}
+ public InputSource getNonNullInputSource(TaskToolbox toolbox)
+ {
+ Preconditions.checkNotNull(inputSource, "inputSource");
+ if (inputSource instanceof TaskInputSource && toolbox != null) {
+ return ((TaskInputSource) inputSource).withTaskToolbox(toolbox);
+ }
+ return inputSource;
+ }
Review Comment:
I think we might need to create it lazily since we don't have the
`TaskToolbox` while setting the `inputSource` in the constructor of
`IndexIOConfig`.
We can avoid multiple calls to `withTaskToolbox` by using an
`AtomicReference` and initializing it lazily but just once (same way that we
have handled `ParallelIndexSupervisorTask.inputSource`.)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]