kaisun2000 commented on PR #15373: URL: https://github.com/apache/druid/pull/15373#issuecomment-1839802271
@abhishekagarwal87 I did some careful examination of peon config in order to achieve the goal -- avoid dropping delay config to be task spec specific. And here is the proposal. First, the historical side delay config is [here](https://github.com/apache/druid/blob/master/server/src/main/java/org/apache/druid/segment/loading/SegmentLoaderConfig.java#L88) in SegmentLoaderConfig. This can't be used in the peon/middlemanager path as peon does not have SegmentLoader. Peon generates segments by itself and then ships them out to deep storage and other components Thus, it looks like we need to introduce a similar config in the peon/middlemanager side. The proper place seems to be in the peon [additional config ](https://druid.apache.org/docs/latest/configuration/#additional-peon-configuration). In the code, it is in the class [TaskConfig](https://github.com/apache/druid/blob/master/indexing-service/src/main/java/org/apache/druid/indexing/common/config/TaskConfig.java). In the Peon code side, the TaskConfig is bound in the`bindTaskConfigAndClients` method. It would be passed into `TaskToolboxFactory` class. Eventually, it would be inside of `TaskToolbox` class. Then in runtime when the peon starts, `ExecutorLifecycle` would have its taskRunner of type `SingleTaskBackgroundRunner` to run the task. `SingleTaskBackgroundRunner` is injected with a copy of `TaskToolboxFactory`. It would delegate to the task to create a runner ('SeekableStreamIndexTaskRunner') to execute the ingestion logic. The nice thing is that the toolbox created by `TaskToolboxFactory` is passed along. Here the toolbox still have the `TaskConfig`. The 'SeekableStreamIndexTaskRunner' would create the appenderator via task of type `SeekableStreamIndexTask` in its ingestion logic. So here, we can add the configuration of delay from `TaskConfig` in the toolbox as an instance variable to appenderator. This seems to achieve the goal of adding a dropping delay config to peon without the config to be task spec specific. Let me know if this proposal looks good? I will try to make the change accordingly next unless I hear it otherwise. -- 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]
