FrankChen021 commented on a change in pull request #11240:
URL: https://github.com/apache/druid/pull/11240#discussion_r647450630



##########
File path: 
extensions-contrib/rocketmq-indexing-service/src/main/java/org/apache/druid/indexing/rocketmq/RocketMQIndexTaskRunner.java
##########
@@ -0,0 +1,171 @@
+/*
+ * 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.indexing.rocketmq;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.druid.data.input.impl.InputRowParser;
+import org.apache.druid.data.input.rocketmq.RocketMQRecordEntity;
+import org.apache.druid.indexing.common.LockGranularity;
+import org.apache.druid.indexing.common.TaskToolbox;
+import 
org.apache.druid.indexing.seekablestream.SeekableStreamDataSourceMetadata;
+import 
org.apache.druid.indexing.seekablestream.SeekableStreamEndSequenceNumbers;
+import org.apache.druid.indexing.seekablestream.SeekableStreamIndexTaskRunner;
+import org.apache.druid.indexing.seekablestream.SeekableStreamSequenceNumbers;
+import org.apache.druid.indexing.seekablestream.SequenceMetadata;
+import 
org.apache.druid.indexing.seekablestream.common.OrderedPartitionableRecord;
+import org.apache.druid.indexing.seekablestream.common.OrderedSequenceNumber;
+import org.apache.druid.indexing.seekablestream.common.RecordSupplier;
+import org.apache.druid.indexing.seekablestream.common.StreamPartition;
+import org.apache.druid.java.util.emitter.EmittingLogger;
+import org.apache.druid.server.security.AuthorizerMapper;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import javax.validation.constraints.NotNull;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+/**
+ * RocketMQ indexing task runner supporting incremental segments publishing
+ */
+public class RocketMQIndexTaskRunner extends 
SeekableStreamIndexTaskRunner<String, Long, RocketMQRecordEntity>
+{
+  private static final EmittingLogger log = new 
EmittingLogger(RocketMQIndexTaskRunner.class);
+  private final RocketMQIndexTask task;
+
+  RocketMQIndexTaskRunner(
+      RocketMQIndexTask task,
+      @Nullable InputRowParser<ByteBuffer> parser,
+      AuthorizerMapper authorizerMapper,
+      LockGranularity lockGranularityToUse
+  )
+  {
+    super(
+        task,
+        parser,
+        authorizerMapper,
+        lockGranularityToUse
+    );
+    this.task = task;
+  }
+
+  @Override
+  protected Long getNextStartOffset(@NotNull Long sequenceNumber)
+  {
+    return sequenceNumber + 1;
+  }
+
+  @Nonnull
+  @Override
+  protected List<OrderedPartitionableRecord<String, Long, 
RocketMQRecordEntity>> getRecords(
+      RecordSupplier<String, Long, RocketMQRecordEntity> recordSupplier,
+      TaskToolbox toolbox
+  )
+  {
+    List<OrderedPartitionableRecord<String, Long, RocketMQRecordEntity>> 
records = new ArrayList<>();

Review comment:
       no need to instantiate a list




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to