You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/07/18 02:08:53 UTC

[GitHub] [inlong] EMsnap commented on a diff in pull request #5079: [INLONG-5074][Sort] KafkaExtractNode support more StartupMode

EMsnap commented on code in PR #5079:
URL: https://github.com/apache/inlong/pull/5079#discussion_r922933408


##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/extract/KafkaExtractNode.java:
##########
@@ -86,14 +89,19 @@ public KafkaExtractNode(@JsonProperty("id") String id,
             @Nonnull @JsonProperty("format") Format format,
             @JsonProperty("scanStartupMode") KafkaScanStartupMode kafkaScanStartupMode,
             @JsonProperty("primaryKey") String primaryKey,
-            @JsonProperty("groupId") String groupId) {
+            @JsonProperty("groupId") String groupId,
+            @JsonProperty("kafkaScanSpecificOffset") String kafkaScanSpecificOffset) {
         super(id, name, fields, watermarkField, properties);
         this.topic = Preconditions.checkNotNull(topic, "kafka topic is empty");
         this.bootstrapServers = Preconditions.checkNotNull(bootstrapServers, "kafka bootstrapServers is empty");
         this.format = Preconditions.checkNotNull(format, "kafka format is empty");
         this.kafkaScanStartupMode = Preconditions.checkNotNull(kafkaScanStartupMode, "kafka scanStartupMode is empty");
         this.primaryKey = primaryKey;
         this.groupId = groupId;
+        if (kafkaScanStartupMode == KafkaScanStartupMode.SPECIFIC_OFFSET) {
+            this.kafkaScanSpecificOffset
+                    = Preconditions.checkNotNull(kafkaScanSpecificOffset, "kafkaScanSpecificOffset is empty");

Review Comment:
   checknotEmpty is better when the parameter is string



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org