yunqingmoswu commented on code in PR #4231:
URL: https://github.com/apache/incubator-inlong/pull/4231#discussion_r874715923
##########
inlong-sort/sort-connectors/pom.xml:
##########
@@ -139,6 +144,12 @@
<artifactId>hadoop-minicluster</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>io.streamnative.connectors</groupId>
+ <artifactId>pulsar-flink-connector_2.11</artifactId>
Review Comment:
The scala version of 2.11 can be replaced by variables?
##########
pom.xml:
##########
@@ -977,6 +978,12 @@
<version>${flink.version}</version>
</dependency>
+ <dependency>
+ <groupId>io.streamnative.connectors</groupId>
+ <artifactId>pulsar-flink-connector_2.11</artifactId>
Review Comment:
The scala version of 2.11 can be replaced by variables?
##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/extract/PulsarExtractNode.java:
##########
@@ -0,0 +1,121 @@
+/*
+ * 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.inlong.sort.protocol.node.extract;
+
+import com.google.common.base.Preconditions;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.commons.lang3.StringUtils;
+import
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
+import
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonTypeName;
+import org.apache.inlong.sort.protocol.FieldInfo;
+import org.apache.inlong.sort.protocol.node.ExtractNode;
+import org.apache.inlong.sort.protocol.node.format.Format;
+import org.apache.inlong.sort.protocol.transformation.WatermarkField;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import java.util.List;
+import java.util.Map;
+
+@EqualsAndHashCode(callSuper = true)
+@JsonTypeName("pulsarExtract")
+@Data
+public class PulsarExtractNode extends ExtractNode {
+ private static final long serialVersionUID = 1L;
+
+ @Nonnull
+ @JsonProperty("topic")
+ private String topic;
+ @Nonnull
+ @JsonProperty("adminUrl")
+ private String adminUrl;
+ @Nonnull
+ @JsonProperty("serviceUrl")
+ private String serviceUrl;
+ @Nonnull
+ @JsonProperty("format")
+ private Format format;
+
+ @JsonProperty("scanStartupMode")
+ private String scanStartupMode;
+
+ @JsonProperty("primaryKey")
+ private String primaryKey;
+
+ @JsonCreator
+ public PulsarExtractNode(@JsonProperty("id") String id,
+ @JsonProperty("name") String name,
+ @JsonProperty("fields") List<FieldInfo> fields,
+ @Nullable @JsonProperty("watermarkField") WatermarkField
watermarkField,
+ @JsonProperty("properties") Map<String, String> properties,
+
+ @Nonnull @JsonProperty("topic") String topic,
+ @Nonnull @JsonProperty("adminUrl") String adminUrl,
+ @Nonnull @JsonProperty("serviceUrl") String serviceUrl,
+ @Nonnull @JsonProperty("format") Format format,
+ @Nonnull @JsonProperty("scanStartupMode") String scanStartupMode,
+ @JsonProperty("primaryKey") String primaryKey) {
+ super(id, name, fields, watermarkField, properties);
+ this.topic = Preconditions.checkNotNull(topic, "pulsar topic is
empty");
Review Comment:
Would it be better to keep the validation message and validation logic all
the time? Maybe it is "xxx is null"?
--
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]