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/08/12 06:11:56 UTC

[GitHub] [inlong] Yizhou-Yang opened a new pull request, #5519: [INLONG-4973][manager] Supplement the Managerctl Commands Tools

Yizhou-Yang opened a new pull request, #5519:
URL: https://github.com/apache/inlong/pull/5519

   ### Modifications
   changed the command line tools, should have no impact on the behavior of the manager.
   
   ### Verifying this change
   added testcases in TestCommand.


-- 
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] [inlong] haifxu commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

Posted by GitBox <gi...@apache.org>.
haifxu commented on code in PR #5519:
URL: https://github.com/apache/inlong/pull/5519#discussion_r949936150


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/DeleteCommand.java:
##########
@@ -0,0 +1,60 @@
+/*
+ * 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 com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import org.apache.inlong.manager.client.api.InlongClient;
+import org.apache.inlong.manager.client.api.InlongGroup;
+import org.apache.inlong.manager.client.cli.util.ClientUtils;
+
+@Parameters(commandDescription = "Delete resource by json file")
+public class DeleteCommand extends AbstractCommand {
+
+    @Parameter()
+    private java.util.List<String> params;
+
+    public DeleteCommand() {
+        super("delete");
+        jcommander.addCommand("group", new DeleteCommand.DeleteGroup());
+    }
+
+    @Parameters(commandDescription = "Delete group by group id")
+    private static class DeleteGroup extends AbstractCommandRunner {
+
+        @Parameter()
+        private java.util.List<String> params;
+
+        @Parameter(names = {"--group", "-g"}, required = true, description = "group id")
+        private String groupId;

Review Comment:
   `group id` -> `inlong group id`



-- 
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] [inlong] healchow merged pull request #5519: [INLONG-5039][Manager] Support delete command, update command, and query execution log for managerctl

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


-- 
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] [inlong] healchow commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

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


##########
inlong-manager/manager-client-tools/src/test/resources/create_group.json:
##########
@@ -41,21 +37,23 @@
   "streamSource": {
     "inlongStreamId": "test_stream",
     "sourceName": "source_name",
-    "hostname": "127.0.0.1",
-    "port": 3306,
-    "user": "root",
-    "password": "123456",
-    "historyFilename": "/data/inlong-agent/.history",
-    "serverTimezone": "UTC",
-    "intervalMs": 1000,
-    "allMigration": false,
-    "databaseWhiteList": "etl",
-    "tableWhiteList": "person",
     "inlongGroupId": "test_group",
-    "sourceType": "BINLOG",
-    "specificOffsetFile": "mysql-bin.000001",
-    "specificOffsetPos": 6972,
-    "snapshotMode": "schema_only_recovery"
+    "sourceType": "FILE",
+    "agentIp": "123.456.789",

Review Comment:
   Please change to `127.0.0.1`.



##########
inlong-manager/manager-client-tools/src/test/resources/test_config.json:
##########
@@ -0,0 +1,9 @@
+{
+  "FlinkSortConf": {
+    "sortType": "flink",
+    "authentication": "NONE",
+    "serviceUrl": "123.456.789",

Review Comment:
   Please change to `127.0.0.1`, and add the default port.



-- 
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] [inlong] healchow commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

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


##########
inlong-manager/manager-client-tools/src/test/java/org/apache/inlong/manager/client/cli/TestCommand.java:
##########
@@ -51,4 +51,23 @@ public void testCreateGroup() {
         String[] arg = {"create", "group", "-f", "src/test/resources/create_group.json"};
         Assertions.assertTrue(inlongAdminTool.run(arg));
     }
+
+    // @Test

Review Comment:
   Why comment out those test methods? Thanks.



-- 
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] [inlong] woofyzhao commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5519:
URL: https://github.com/apache/inlong/pull/5519#discussion_r950002013


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/CreateCommand.java:
##########
@@ -51,26 +51,38 @@ private static class CreateGroup extends AbstractCommandRunner {
 
         @Parameter(names = {"-f", "--file"},
                 converter = FileConverter.class,
-                required = true,
                 description = "json file")
         private File file;
 
+        //TODO:add gdbc connector and others

Review Comment:
   Suggest leaving a blank between start of comment // and _text_ which is the case in all other inlong source files. 



-- 
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] [inlong] healchow commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

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


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/CreateCommand.java:
##########
@@ -51,26 +51,38 @@ private static class CreateGroup extends AbstractCommandRunner {
 
         @Parameter(names = {"-f", "--file"},
                 converter = FileConverter.class,
-                required = true,
                 description = "json file")
         private File file;
 
+        // TODO:add gdbc connector and others

Review Comment:
   jdbc?



-- 
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] [inlong] haifxu commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

Posted by GitBox <gi...@apache.org>.
haifxu commented on code in PR #5519:
URL: https://github.com/apache/inlong/pull/5519#discussion_r949972592


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/LogCommand.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * 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 com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import com.github.pagehelper.PageInfo;
+import org.apache.inlong.manager.client.api.inner.client.InlongGroupClient;
+import org.apache.inlong.manager.client.cli.pojo.GroupInfo;
+import org.apache.inlong.manager.client.cli.util.ClientUtils;
+import org.apache.inlong.manager.client.cli.util.PrintUtils;
+import org.apache.inlong.manager.pojo.group.InlongGroupBriefInfo;
+import org.apache.inlong.manager.pojo.group.InlongGroupPageRequest;
+import java.util.List;
+
+/**
+ * Log resource
+ */
+@Parameters(commandDescription = "Log resource")
+public class LogCommand extends AbstractCommand {
+
+    @Parameter()
+    private List<String> params;
+
+    public LogCommand() {
+        super("log");
+        jcommander.addCommand("group", new CreateGroup());
+    }
+
+    @Parameters(commandDescription = "Log group")
+    private static class CreateGroup extends AbstractCommandRunner {
+
+        @Parameter()
+        private java.util.List<String> params;

Review Comment:
   Use `List<String>` pls.



##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/UpdateCommand.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * 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 com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.client.api.InlongClient;
+import org.apache.inlong.manager.client.api.InlongGroup;
+import org.apache.inlong.manager.client.cli.util.ClientUtils;
+import org.apache.inlong.manager.pojo.sort.BaseSortConf;
+
+import java.io.File;
+
+@Parameters(commandDescription = "Update resource by json file")
+public class UpdateCommand extends AbstractCommand {
+
+    @Parameter()
+    private java.util.List<String> params;

Review Comment:
   Ditto



-- 
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] [inlong] woofyzhao commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5519:
URL: https://github.com/apache/inlong/pull/5519#discussion_r950002013


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/CreateCommand.java:
##########
@@ -51,26 +51,38 @@ private static class CreateGroup extends AbstractCommandRunner {
 
         @Parameter(names = {"-f", "--file"},
                 converter = FileConverter.class,
-                required = true,
                 description = "json file")
         private File file;
 
+        //TODO:add gdbc connector and others

Review Comment:
   Suggest leave a blank between start of comment // and _text_ which is the case in all other inlong source files. 



-- 
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] [inlong] healchow commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

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


##########
inlong-manager/manager-client-tools/src/test/resources/create_group.json:
##########
@@ -41,21 +37,23 @@
   "streamSource": {
     "inlongStreamId": "test_stream",
     "sourceName": "source_name",
-    "hostname": "127.0.0.1",
-    "port": 3306,
-    "user": "root",
-    "password": "123456",
-    "historyFilename": "/data/inlong-agent/.history",
-    "serverTimezone": "UTC",
-    "intervalMs": 1000,
-    "allMigration": false,
-    "databaseWhiteList": "etl",
-    "tableWhiteList": "person",
     "inlongGroupId": "test_group",
-    "sourceType": "BINLOG",
-    "specificOffsetFile": "mysql-bin.000001",
-    "specificOffsetPos": 6972,
-    "snapshotMode": "schema_only_recovery"
+    "sourceType": "FILE",
+    "agentIp": "127.0.0.1",
+    "uuid": "127.0.0.1",
+    "clusterId": "123",
+    "inlongClusterName": "hi",
+    "dataNodeName": "hi2",
+    "serializationType": "csv",
+    "snapshot": "hi3",
+    "version": "4",
+    "status": "5",
+    "previousStatus": "6",
+    "creator": "me",
+    "modifier": "none",
+    "createTime": "2000-07-08 12:05:12",
+    "modifyTime": "2000-07-08 12:05:12",

Review Comment:
   Those fields are not required when creating a group.



-- 
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] [inlong] healchow commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

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


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/LogCommand.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * 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 com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.client.api.inner.client.InlongGroupClient;
+import org.apache.inlong.manager.client.cli.pojo.GroupInfo;
+import org.apache.inlong.manager.client.cli.util.ClientUtils;
+import org.apache.inlong.manager.client.cli.util.PrintUtils;
+import org.apache.inlong.manager.pojo.group.InlongGroupBriefInfo;
+import org.apache.inlong.manager.pojo.group.InlongGroupPageRequest;
+
+import java.util.List;
+
+/**
+ * The log command used to get filter certain kinds of inlong groups
+ */
+@Parameters(commandDescription = "Log resource")
+public class LogCommand extends AbstractCommand {
+
+    @Parameter()
+    private List<String> params;
+
+    public LogCommand() {
+        super("log");
+        jcommander.addCommand("group", new CreateGroup());
+    }
+
+    @Parameters(commandDescription = "Log group")
+    private static class CreateGroup extends AbstractCommandRunner {
+
+        @Parameter()
+        private List<String> params;
+
+        @Parameter(names = {"--query"}, required = true, description = "condition filters")
+        private String input;
+
+        @Override
+        void run() {
+            final int MAX_LOG_SIZE = 100;
+            try {
+                // for now only filter by one condition. TODO:support OR and AND, make a condition filter.
+                // sample input: inlongGroupId:test_group
+                if(input == null) {
+                    System.err.println("empty input");
+                    return;
+                }
+                String[] inputs = input.split(":");
+                ClientUtils.initClientFactory();
+                InlongGroupClient groupClient = ClientUtils.clientFactory.getGroupClient();
+                InlongGroupPageRequest pageRequest = new InlongGroupPageRequest();
+                if (inputs.length<2 || StringUtils.isBlank(inputs[1])) {
+                    System.err.println("invalid input");

Review Comment:
   "the input must contain ':'"



-- 
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] [inlong] healchow commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

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


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/LogCommand.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * 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 com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import com.github.pagehelper.PageInfo;
+import org.apache.inlong.manager.client.api.inner.client.InlongGroupClient;
+import org.apache.inlong.manager.client.cli.pojo.GroupInfo;
+import org.apache.inlong.manager.client.cli.util.ClientUtils;
+import org.apache.inlong.manager.client.cli.util.PrintUtils;
+import org.apache.inlong.manager.pojo.group.InlongGroupBriefInfo;
+import org.apache.inlong.manager.pojo.group.InlongGroupPageRequest;
+
+import java.util.List;
+
+/**
+ * The log command used to get filter certain kinds of inlong groups
+ * Please refer to the document for parameters

Review Comment:
   Where is the link to the document?
   Suggested remove this line.



-- 
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] [inlong] haifxu commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

Posted by GitBox <gi...@apache.org>.
haifxu commented on code in PR #5519:
URL: https://github.com/apache/inlong/pull/5519#discussion_r949937782


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/UpdateCommand.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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 com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import com.beust.jcommander.converters.FileConverter;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.client.api.InlongClient;
+import org.apache.inlong.manager.client.api.InlongGroup;
+import org.apache.inlong.manager.client.cli.util.ClientUtils;
+import org.apache.inlong.manager.pojo.sort.BaseSortConf;
+
+import java.io.File;
+
+@Parameters(commandDescription = "Update resource by json file")
+public class UpdateCommand extends AbstractCommand {
+
+    @Parameter()
+    private java.util.List<String> params;
+
+    public UpdateCommand() {
+        super("update");
+        jcommander.addCommand("group", new UpdateCommand.UpdateGroup());
+    }
+
+    @Parameters(commandDescription = "Update group by json file")
+    private static class UpdateGroup extends AbstractCommandRunner {
+
+        @Parameter()
+        private java.util.List<String> params;
+
+        @Parameter(names = {"--group", "-g"}, required = true)
+        private String groupId;

Review Comment:
   Please add description.



-- 
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] [inlong] haifxu commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

Posted by GitBox <gi...@apache.org>.
haifxu commented on code in PR #5519:
URL: https://github.com/apache/inlong/pull/5519#discussion_r949939770


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/pojo/GroupInfo.java:
##########
@@ -34,6 +35,7 @@ public class GroupInfo {
 
     @ParseStatus
     private String status;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date modifyTime;

Review Comment:
   Other pojos with `Date` fields may also need this annotation.



-- 
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] [inlong] healchow commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

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


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/LogCommand.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * 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 com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.client.api.inner.client.InlongGroupClient;
+import org.apache.inlong.manager.client.cli.pojo.GroupInfo;
+import org.apache.inlong.manager.client.cli.util.ClientUtils;
+import org.apache.inlong.manager.client.cli.util.PrintUtils;
+import org.apache.inlong.manager.pojo.group.InlongGroupBriefInfo;
+import org.apache.inlong.manager.pojo.group.InlongGroupPageRequest;
+
+import java.util.List;
+
+/**
+ * The log command used to get filter certain kinds of inlong groups
+ */
+@Parameters(commandDescription = "Log resource")
+public class LogCommand extends AbstractCommand {
+
+    @Parameter()
+    private List<String> params;
+
+    public LogCommand() {
+        super("log");
+        jcommander.addCommand("group", new CreateGroup());
+    }
+
+    @Parameters(commandDescription = "Log group")
+    private static class CreateGroup extends AbstractCommandRunner {
+
+        @Parameter()
+        private List<String> params;
+
+        @Parameter(names = {"--query"}, required = true, description = "condition filters")
+        private String input;
+
+        @Override
+        void run() {
+            final int MAX_LOG_SIZE = 100;
+            try {
+                // for now only filter by one condition. TODO:support OR and AND, make a condition filter.
+                // sample input: inlongGroupId:test_group
+                if(input == null) {
+                    System.err.println("empty input");

Review Comment:
   "the input cannot be empty, for example: inlongGroupId:test_group"



-- 
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] [inlong] woofyzhao commented on a diff in pull request #5519: [INLONG-4973][Manager] Supplement the Managerctl Commands Tools

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5519:
URL: https://github.com/apache/inlong/pull/5519#discussion_r950004490


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/DeleteCommand.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * 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 com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import org.apache.inlong.manager.client.api.InlongClient;
+import org.apache.inlong.manager.client.api.InlongGroup;
+import org.apache.inlong.manager.client.cli.util.ClientUtils;
+
+import java.util.List;
+
+@Parameters(commandDescription = "Delete resource by json file")
+public class DeleteCommand extends AbstractCommand {

Review Comment:
   Please add comment doc for public class



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