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/05/19 04:11:53 UTC

[GitHub] [incubator-inlong] thexiay opened a new pull request, #4261: [INLONG-4259][Sort] Import inlong format json serialize/deserialize

thexiay opened a new pull request, #4261:
URL: https://github.com/apache/incubator-inlong/pull/4261

   ### Title Name: [INLONG-4259][Sort] Import inlong format json serialize/deserialize
   
   Import inlong format json serialize/deserialize
   
   Fixes 4259
   
   ### Motivation
   
   Import inlong format json serialize/deserialize
   
   ### Modifications
   
   Add Json Serialize InLongMsg format and its ut.


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


[GitHub] [incubator-inlong] yunqingmoswu commented on a diff in pull request #4261: [INLONG-4259][Sort] Import inlong format json serialize/deserialize

Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on code in PR #4261:
URL: https://github.com/apache/incubator-inlong/pull/4261#discussion_r876601870


##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/format/InLongMsgFormat.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.format;
+
+import lombok.Data;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
+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.common.msg.InLongMsg;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The {@link InLongMsg} format.
+ *
+ * @see <a href="https://inlong.apache.org/docs/development/inlong_msg">InLongMsg Format</a>
+ */
+@JsonTypeName("inLongMsgFormat")
+@Data
+public class InLongMsgFormat implements Format {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonProperty(value = "innerFormat")
+    private Format innerFormat;
+
+    @JsonProperty(value = "ignoreParseErrors", defaultValue = "false")
+    private Boolean ignoreParseErrors;
+
+    @JsonCreator
+    public InLongMsgFormat(@JsonProperty(value = "innerFormat") Format innerFormat,

Review Comment:
   Please add some java comments.



##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/format/InLongMsgFormat.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.format;
+
+import lombok.Data;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
+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.common.msg.InLongMsg;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The {@link InLongMsg} format.
+ *
+ * @see <a href="https://inlong.apache.org/docs/development/inlong_msg">InLongMsg Format</a>
+ */
+@JsonTypeName("inLongMsgFormat")
+@Data
+public class InLongMsgFormat implements Format {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonProperty(value = "innerFormat")
+    private Format innerFormat;
+
+    @JsonProperty(value = "ignoreParseErrors", defaultValue = "false")
+    private Boolean ignoreParseErrors;
+
+    @JsonCreator
+    public InLongMsgFormat(@JsonProperty(value = "innerFormat") Format innerFormat,
+            @JsonProperty(value = "ignoreParseErrors", defaultValue = "false") Boolean ignoreParseErrors) {
+        this.innerFormat = innerFormat;
+        this.ignoreParseErrors = ignoreParseErrors;
+    }
+
+    @JsonCreator

Review Comment:
   Maybe it is must unique?



##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/format/InLongMsgFormat.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.format;
+
+import lombok.Data;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
+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.common.msg.InLongMsg;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The {@link InLongMsg} format.
+ *
+ * @see <a href="https://inlong.apache.org/docs/development/inlong_msg">InLongMsg Format</a>
+ */
+@JsonTypeName("inLongMsgFormat")
+@Data
+public class InLongMsgFormat implements Format {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonProperty(value = "innerFormat")
+    private Format innerFormat;
+
+    @JsonProperty(value = "ignoreParseErrors", defaultValue = "false")
+    private Boolean ignoreParseErrors;
+
+    @JsonCreator
+    public InLongMsgFormat(@JsonProperty(value = "innerFormat") Format innerFormat,
+            @JsonProperty(value = "ignoreParseErrors", defaultValue = "false") Boolean ignoreParseErrors) {
+        this.innerFormat = innerFormat;
+        this.ignoreParseErrors = ignoreParseErrors;
+    }
+
+    @JsonCreator
+    public InLongMsgFormat() {

Review Comment:
   Please add some java comments.



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


[GitHub] [incubator-inlong] thexiay commented on a diff in pull request #4261: [INLONG-4259][Sort] Import inlong format json serialize/deserialize

Posted by GitBox <gi...@apache.org>.
thexiay commented on code in PR #4261:
URL: https://github.com/apache/incubator-inlong/pull/4261#discussion_r876713801


##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/format/InLongMsgFormat.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.format;
+
+import lombok.Data;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
+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.common.msg.InLongMsg;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The {@link InLongMsg} format.
+ *
+ * @see <a href="https://inlong.apache.org/docs/development/inlong_msg">InLongMsg Format</a>
+ */
+@JsonTypeName("inLongMsgFormat")
+@Data
+public class InLongMsgFormat implements Format {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonProperty(value = "innerFormat")
+    private Format innerFormat;
+
+    @JsonProperty(value = "ignoreParseErrors", defaultValue = "false")
+    private Boolean ignoreParseErrors;
+
+    @JsonCreator
+    public InLongMsgFormat(@JsonProperty(value = "innerFormat") Format innerFormat,
+            @JsonProperty(value = "ignoreParseErrors", defaultValue = "false") Boolean ignoreParseErrors) {
+        this.innerFormat = innerFormat;
+        this.ignoreParseErrors = ignoreParseErrors;
+    }
+
+    @JsonCreator
+    public InLongMsgFormat() {

Review Comment:
   > 
   
   already add in class define.



##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/format/InLongMsgFormat.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.format;
+
+import lombok.Data;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
+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.common.msg.InLongMsg;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The {@link InLongMsg} format.
+ *
+ * @see <a href="https://inlong.apache.org/docs/development/inlong_msg">InLongMsg Format</a>
+ */
+@JsonTypeName("inLongMsgFormat")
+@Data
+public class InLongMsgFormat implements Format {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonProperty(value = "innerFormat")
+    private Format innerFormat;
+
+    @JsonProperty(value = "ignoreParseErrors", defaultValue = "false")
+    private Boolean ignoreParseErrors;
+
+    @JsonCreator
+    public InLongMsgFormat(@JsonProperty(value = "innerFormat") Format innerFormat,
+            @JsonProperty(value = "ignoreParseErrors", defaultValue = "false") Boolean ignoreParseErrors) {
+        this.innerFormat = innerFormat;
+        this.ignoreParseErrors = ignoreParseErrors;
+    }
+
+    @JsonCreator
+    public InLongMsgFormat() {

Review Comment:
   already add in class define.



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


[GitHub] [incubator-inlong] healchow merged pull request #4261: [INLONG-4259][Sort] Import inlong format json serialize/deserialize

Posted by GitBox <gi...@apache.org>.
healchow merged PR #4261:
URL: https://github.com/apache/incubator-inlong/pull/4261


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


[GitHub] [incubator-inlong] thexiay commented on a diff in pull request #4261: [INLONG-4259][Sort] Import inlong format json serialize/deserialize

Posted by GitBox <gi...@apache.org>.
thexiay commented on code in PR #4261:
URL: https://github.com/apache/incubator-inlong/pull/4261#discussion_r876592269


##########
inlong-sort/sort-common/src/test/java/org/apache/inlong/sort/protocol/node/format/InLongMsgFormatTest.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.format;
+
+import org.apache.inlong.sort.SerializeBaseTest;
+
+/**
+ * Test for {@link AvroFormat}

Review Comment:
   doc error.



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