jon-wei commented on a change in pull request #8107: Add CliIndexer process 
type and initial task runner implementation
URL: https://github.com/apache/incubator-druid/pull/8107#discussion_r306090154
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/segment/realtime/appenderator/UnifiedIndexerAppenderatorsManager.java
 ##########
 @@ -0,0 +1,206 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.segment.realtime.appenderator;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.Preconditions;
+import com.google.inject.Inject;
+import org.apache.druid.client.cache.Cache;
+import org.apache.druid.client.cache.CacheConfig;
+import org.apache.druid.client.cache.CachePopulatorStats;
+import org.apache.druid.guice.annotations.Processing;
+import org.apache.druid.java.util.common.IAE;
+import org.apache.druid.java.util.common.logger.Logger;
+import org.apache.druid.java.util.emitter.service.ServiceEmitter;
+import org.apache.druid.query.Query;
+import org.apache.druid.query.QueryRunner;
+import org.apache.druid.query.QueryRunnerFactoryConglomerate;
+import org.apache.druid.query.SegmentDescriptor;
+import org.apache.druid.segment.IndexIO;
+import org.apache.druid.segment.IndexMerger;
+import org.apache.druid.segment.indexing.DataSchema;
+import org.apache.druid.segment.loading.DataSegmentPusher;
+import org.apache.druid.segment.realtime.FireDepartmentMetrics;
+import org.apache.druid.segment.realtime.plumber.Sink;
+import org.apache.druid.server.coordination.DataSegmentAnnouncer;
+import org.apache.druid.timeline.VersionedIntervalTimeline;
+import org.joda.time.Interval;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+
+/**
+ * Manages Appenderators for the Indexer task execution service, which runs 
all tasks in a single process.
+ *
+ * This class keeps two maps:
+ * - A per-datasource SinkQuerySegmentWalker (with an associated 
per-datasource timeline)
+ * - A map that associates a taskId with the Appenderator created for that task
+ *
+ * Appenderators created by this class will use the shared per-datasource 
SinkQuerySegmentWalkers.
+ *
+ * The per-datasource SinkQuerySegmentWalkers share a common 
queryExecutorService.
+ */
+public class UnifiedIndexerAppenderatorsManager implements AppenderatorsManager
+{
+  private static final Logger log = new 
Logger(UnifiedIndexerAppenderatorsManager.class);
+
+  private final ConcurrentHashMap<String, SinkQuerySegmentWalker> 
datasourceSegmentWalkers = new ConcurrentHashMap<>();
+  private final ConcurrentHashMap<String, Appenderator> taskAppenderatorMap = 
new ConcurrentHashMap<>();
 
 Review comment:
   It's something that would've been expanded in follow on PRs, but I removed 
it for now

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

Reply via email to