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/04/08 11:14:14 UTC

[GitHub] [incubator-inlong] haifxu opened a new pull request, #3582: [INLONG-3579][Manager] Add create command for client tools

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

   ### Title Name: [INLONG-3579][Manager] Add create command for client tools
   
   Fixes #3579 
   
   ### Modifications
   
   Add create command for client tools
   
   ### Verifying this change
   
   ```
   Usage: managerctl create [command] [command options]
     Commands:
       stream      Create stream by json file
         Usage: stream [options]
           Options:
           * -f, --file
           
       group      Create group by json file
         Usage: group [options]
           Options:
           * -f, --file
   
       sink      Create group by json file
         Usage: sink [options]
           Options:
           * -f, --file
   
       source      Create group by json file
         Usage: source [options]
           Options:
           * -f, --file
   ```


-- 
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 commented on a diff in pull request #3582: [INLONG-3579][Manager] Add create command for client tools

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


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/util/GsonUtil.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * 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.manager.client.cli.util;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import org.apache.inlong.manager.client.api.DataFormat;
+import org.apache.inlong.manager.client.api.DataSeparator;
+import org.apache.inlong.manager.client.api.MQBaseConf;
+import org.apache.inlong.manager.client.api.SortBaseConf;
+import org.apache.inlong.manager.client.api.StreamSink;
+import org.apache.inlong.manager.client.api.StreamSource;
+
+import java.nio.charset.Charset;
+
+public class GsonUtil {
+
+    public Gson gsonBuilder() {

Review Comment:
   It is better to use a global static Gson object.



-- 
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] dockerzhang merged pull request #3582: [INLONG-3579][Manager] Add create command for client tools

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


-- 
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 commented on a diff in pull request #3582: [INLONG-3579][Manager] Add create command for client tools

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


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/CommandDescribe.java:
##########
@@ -48,13 +48,13 @@ private class DescribeStream extends CommandUtil {
         @Parameter()
         private java.util.List<String> params;
 
-        @Parameter(names = {"-g", "--group"}, required = true, description = "Get stream details by group id.")
+        @Parameter(names = {"-g", "--group"}, required = true, description = "group id.")

Review Comment:
   Replace all to `inlong group id`, note: not add `.` at the end.



##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/CreateGroupConf.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.manager.client.cli;
+
+import lombok.Data;
+import org.apache.inlong.manager.client.api.InlongGroupConf;
+import org.apache.inlong.manager.client.api.InlongStreamConf;
+import org.apache.inlong.manager.client.api.StreamField;
+import org.apache.inlong.manager.client.api.sink.HiveSink;
+import org.apache.inlong.manager.client.api.source.KafkaSource;
+
+import java.util.List;
+
+@Data
+public class CreateGroupConf {
+
+    private InlongGroupConf groupConf;
+    private InlongStreamConf streamConf;
+    private List<StreamField> streamFieldList;
+    private KafkaSource kafkaSource;

Review Comment:
   It is recommended to use an abstract class instead of a specific type of source or sink.



##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/util/FlinkConfAdapter.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.manager.client.cli.util;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import org.apache.inlong.manager.client.api.FlinkSortBaseConf;
+
+import java.lang.reflect.Type;
+
+public class FlinkConfAdapter<T> implements JsonDeserializer<T> {
+    @Override
+    public T deserialize(JsonElement jsonElement,
+                         Type type,

Review Comment:
   No need to indent parameters.



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