Class UnifiedIndexerAppenderatorsManager

java.lang.Object
org.apache.druid.segment.realtime.appenderator.UnifiedIndexerAppenderatorsManager
All Implemented Interfaces:
AppenderatorsManager

public class UnifiedIndexerAppenderatorsManager extends Object implements AppenderatorsManager
Manages Appenderator instances for the CliIndexer task execution service, which runs all tasks in a single process. This class keeps a map of UnifiedIndexerAppenderatorsManager.DatasourceBundle objects, keyed by datasource name. Each bundle contains: - A per-datasource SinkQuerySegmentWalker (with an associated per-datasource timeline) - A map that associates a taskId with a list of Appenderators created for that task Access to the datasource bundle map and the task->appenderator maps is synchronized. The methods on this class can be called concurrently from multiple task threads. If there are no remaining appenderators for a given datasource, the corresponding bundle will be removed from the bundle map. Appenderators created by this class will use the shared per-datasource SinkQuerySegmentWalkers. The per-datasource SinkQuerySegmentWalkers share a common queryExecutorService. Each task that requests an Appenderator from this AppenderatorsManager will receive a heap memory limit equal to WorkerConfig.globalIngestionHeapLimitBytes evenly divided by WorkerConfig.capacity. This assumes that each task will only ingest to one Appenderator simultaneously. The Appenderators created by this class share an executor pool for IndexMerger persist and merge operations, with concurrent operations limited to `druid.worker.capacity` divided 2. This limit is imposed to reduce overall memory usage.