javeme commented on code in PR #2278:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2278#discussion_r1320468332


##########
hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java:
##########
@@ -264,4 +264,36 @@ public static synchronized ServerOptions instance() {
                     disallowEmpty(),
                     true
             );
+
+    public static final ConfigOption<String> ARTHAS_TELNET_PORT =
+        new ConfigOption<>(
+            "arthas.telnet_port",
+            "arthas provides telnet ports to the outside",
+            disallowEmpty(),
+            "8562"
+        );
+
+    public static final ConfigOption<String> ARTHAS_HTTP_PORT =
+        new ConfigOption<>(
+            "arthas.http_port",
+            "arthas provides http ports to the outside",
+            disallowEmpty(),
+            "8561"
+        );
+
+    public static final ConfigOption<String> ARTHAS_IP =
+        new ConfigOption<>(
+            "arthas.ip",
+            "arthas bound ip",

Review Comment:
   can we improve description style



##########
hugegraph-api/src/main/java/org/apache/hugegraph/api/arthas/ArthasAPI.java:
##########
@@ -0,0 +1,57 @@
+/*
+ * 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.hugegraph.api.arthas;
+
+import java.util.HashMap;
+
+import org.apache.hugegraph.api.API;
+import org.apache.hugegraph.config.HugeConfig;
+import org.apache.hugegraph.config.ServerOptions;
+import org.apache.hugegraph.util.JsonUtil;
+
+import com.codahale.metrics.annotation.Timed;
+import com.taobao.arthas.agent.attach.ArthasAgent;
+
+import jakarta.inject.Singleton;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.Context;
+
+@Path("arthas")
+@Singleton
+public class ArthasAPI extends API {
+
+    @Context
+    private jakarta.inject.Provider<HugeConfig> configProvider;
+
+    @PUT
+    @Timed
+    @Produces(APPLICATION_JSON_WITH_CHARSET)
+    public Object startArthas() {
+        HugeConfig config = this.configProvider.get();
+        HashMap<String, String> configMap = new HashMap<>(4);
+        configMap.put("arthas.telnet_ort", 
config.get(ServerOptions.ARTHAS_TELNET_PORT));

Review Comment:
   ort => port



##########
hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java:
##########
@@ -264,4 +264,36 @@ public static synchronized ServerOptions instance() {
                     disallowEmpty(),
                     true
             );
+
+    public static final ConfigOption<String> ARTHAS_TELNET_PORT =
+        new ConfigOption<>(
+            "arthas.telnet_port",
+            "arthas provides telnet ports to the outside",

Review Comment:
   ports or only one port?



##########
hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java:
##########
@@ -264,4 +264,36 @@ public static synchronized ServerOptions instance() {
                     disallowEmpty(),
                     true
             );
+
+    public static final ConfigOption<String> ARTHAS_TELNET_PORT =
+        new ConfigOption<>(
+            "arthas.telnet_port",
+            "arthas provides telnet ports to the outside",
+            disallowEmpty(),
+            "8562"
+        );
+
+    public static final ConfigOption<String> ARTHAS_HTTP_PORT =
+        new ConfigOption<>(
+            "arthas.http_port",
+            "arthas provides http ports to the outside",
+            disallowEmpty(),
+            "8561"
+        );
+
+    public static final ConfigOption<String> ARTHAS_IP =
+        new ConfigOption<>(
+            "arthas.ip",
+            "arthas bound ip",
+            disallowEmpty(),
+            "0.0.0.0"
+        );
+
+    public static final ConfigOption<String> ARTHAS_DISABLED_COMMANDS =
+        new ConfigOption<>(
+            "arthas.disabled_commands",
+            "arthas disabled commands",
+            disallowEmpty(),
+            "jad"

Review Comment:
   we can change to choice option here



##########
hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java:
##########
@@ -264,4 +264,35 @@ public static synchronized ServerOptions instance() {
                     disallowEmpty(),
                     true
             );
+
+
+    public static final ConfigOption<String> ARTHAS_TELNET_PORT =
+        new ConfigOption<>(
+            "arthas.telnetPort",
+            "arthas provides telnet ports to the outside",
+            disallowEmpty(),
+            "8562"
+        );
+    public static final ConfigOption<String> ARTHAS_HTTP_PORT =
+        new ConfigOption<>(
+            "arthas.httpPort",
+            "arthas provides http ports to the outside",
+            disallowEmpty(),
+            "8561"
+        );
+    public static final ConfigOption<String> ARTHAS_IP =
+        new ConfigOption<>(
+            "arthas.ip",
+            "arthas bound ip",
+            disallowEmpty(),
+            "0.0.0.0"
+        );
+    public static final ConfigOption<String> ARTHAS_DISABLED_COMMANDS =
+        new ConfigOption<>(
+            "arthas.disabledCommands",
+            "arthas disabled commands",

Review Comment:
   could you please add more details for the description, since it will be as a 
guide for users.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to