javeme commented on code in PR #2278:
URL:
https://github.com/apache/incubator-hugegraph/pull/2278#discussion_r1327964538
##########
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 port to the outside",
+ disallowEmpty(),
+ "8562"
+ );
+
+ public static final ConfigOption<String> ARTHAS_HTTP_PORT =
+ new ConfigOption<>(
+ "arthas.http_port",
+ "The HTTP port provided by Arthas, it can be accessible from the
outside.",
Review Comment:
could you please also improve the description of other options?
##########
hugegraph-api/src/main/java/org/apache/hugegraph/api/arthas/ArthasAPI.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.telnetPort",
config.get(ServerOptions.ARTHAS_TELNET_PORT));
+ configMap.put("arthas.httpPort",
config.get(ServerOptions.ARTHAS_HTTP_PORT));
+ configMap.put("arthas.ip", config.get(ServerOptions.ARTHAS_IP));
+
configMap.put("arthas.disabledCommands",config.get(ServerOptions.ARTHAS_DISABLED_COMMANDS));
Review Comment:
expect a space after "," or wrap line after it
--
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]