[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5266: Add PinotServiceManager to start Pinot components

2020-05-27 Thread GitBox


fx19880617 commented on a change in pull request #5266:
URL: https://github.com/apache/incubator-pinot/pull/5266#discussion_r430928817



##
File path: 
pinot-common/src/main/java/org/apache/pinot/common/utils/ServiceStatus.java
##
@@ -43,17 +44,79 @@
  */
 @SuppressWarnings("unused")
 public class ServiceStatus {
+  public static final String STATUS_DESCRIPTION_NONE = "None";
+  public static final String STATUS_DESCRIPTION_INIT = "Init";
+  public static final String STATUS_DESCRIPTION_STARTED = "Started";
+  public static final String STATUS_DESCRIPTION_NO_HELIX_STATE = "Helix state 
does not exist";
   private static final Logger LOGGER = 
LoggerFactory.getLogger(ServiceStatus.class);
+  private static final int MAX_RESOURCE_NAMES_TO_LOG = 5;
+  private static final Map 
serviceStatusCallbackMap = new ConcurrentHashMap<>();
+  private static final ServiceStatusCallback serviceStatusCallback =
+  new 
MapBasedMultipleCallbackServiceStatusCallback(serviceStatusCallbackMap);
 
-  public enum Status {
-STARTING, GOOD, BAD
+  public static void setServiceStatusCallback(String name, 
ServiceStatusCallback serviceStatusCallback) {
+ServiceStatus.serviceStatusCallbackMap.put(name, serviceStatusCallback);
   }
 
-  public static final String STATUS_DESCRIPTION_NONE = "None";
-  public static final String STATUS_DESCRIPTION_INIT = "Init";
-  public static final String STATUS_DESCRIPTION_NO_HELIX_STATE = "Helix state 
does not exist";
+  public static void removeServiceStatusCallback(String name) {
+ServiceStatus.serviceStatusCallbackMap.remove(name);
+  }
 
-  private static final int MAX_RESOURCE_NAMES_TO_LOG = 5;
+  public static Status getServiceStatus() {
+return getServiceStatus(serviceStatusCallback);
+  }
+
+  public static Status getServiceStatus(String name) {
+if (serviceStatusCallbackMap.containsKey(name)) {
+  return getServiceStatus(serviceStatusCallbackMap.get(name));
+} else {
+  return Status.NOT_STARTED;

Review comment:
   Got it. Added `SHUTTING_DOWN` status.
   My feeling is that during shutting down phase, the 
`getServiceStatus(serviceStatusCallbackMap.get(name))` should return 
`SHUTTING_DOWN`.
   
   Once server is completely shutdown, it will be removed from the 
`serviceStatusCallbackMap` so the status will be `NOT_STARTED`
   





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org



[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5266: Add PinotServiceManager to start Pinot components

2020-05-22 Thread GitBox


fx19880617 commented on a change in pull request #5266:
URL: https://github.com/apache/incubator-pinot/pull/5266#discussion_r429422165



##
File path: 
pinot-spi/src/main/java/org/apache/pinot/spi/services/ServiceStartable.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.pinot.spi.services;
+
+import org.apache.commons.configuration.Configuration;
+
+
+/**
+ * ServiceStartable is the general interface to manage a Pinot instance 
lifecycle for a specific ServiceRole.
+ * E.g. Controller/Broker/Server/Minion.
+ *
+ */
+public interface ServiceStartable {

Review comment:
   Changed to StartableService
   





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org



[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5266: Add PinotServiceManager to start Pinot components

2020-05-22 Thread GitBox


fx19880617 commented on a change in pull request #5266:
URL: https://github.com/apache/incubator-pinot/pull/5266#discussion_r429123256



##
File path: 
pinot-common/src/main/java/org/apache/pinot/common/utils/ServiceStatus.java
##
@@ -43,17 +44,79 @@
  */
 @SuppressWarnings("unused")
 public class ServiceStatus {
+  public static final String STATUS_DESCRIPTION_NONE = "None";
+  public static final String STATUS_DESCRIPTION_INIT = "Init";
+  public static final String STATUS_DESCRIPTION_STARTED = "Started";
+  public static final String STATUS_DESCRIPTION_NO_HELIX_STATE = "Helix state 
does not exist";
   private static final Logger LOGGER = 
LoggerFactory.getLogger(ServiceStatus.class);
+  private static final int MAX_RESOURCE_NAMES_TO_LOG = 5;
+  private static final Map 
serviceStatusCallbackMap = new ConcurrentHashMap<>();
+  private static final ServiceStatusCallback serviceStatusCallback =
+  new 
MapBasedMultipleCallbackServiceStatusCallback(serviceStatusCallbackMap);
 
-  public enum Status {
-STARTING, GOOD, BAD
+  public static void setServiceStatusCallback(String name, 
ServiceStatusCallback serviceStatusCallback) {
+ServiceStatus.serviceStatusCallbackMap.put(name, serviceStatusCallback);
   }
 
-  public static final String STATUS_DESCRIPTION_NONE = "None";
-  public static final String STATUS_DESCRIPTION_INIT = "Init";
-  public static final String STATUS_DESCRIPTION_NO_HELIX_STATE = "Helix state 
does not exist";
+  public static void removeServiceStatusCallback(String name) {
+ServiceStatus.serviceStatusCallbackMap.remove(name);
+  }
 
-  private static final int MAX_RESOURCE_NAMES_TO_LOG = 5;
+  public static Status getServiceStatus() {
+return getServiceStatus(serviceStatusCallback);
+  }
+
+  public static Status getServiceStatus(String name) {
+if (serviceStatusCallbackMap.containsKey(name)) {
+  return getServiceStatus(serviceStatusCallbackMap.get(name));
+} else {
+  return Status.NOT_STARTED;

Review comment:
   We  have status of `NOT_STARTED`, `STARTING`, `GOOD`, `BAD` for now.
   I feel it's ok to say `NOT_STARTED` after we stop an instance, as it's still 
possible to start a new instance later on.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org



[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5266: Add PinotServiceManager to start Pinot components

2020-05-22 Thread GitBox


fx19880617 commented on a change in pull request #5266:
URL: https://github.com/apache/incubator-pinot/pull/5266#discussion_r429120606



##
File path: 
pinot-common/src/main/java/org/apache/pinot/common/utils/ServiceStatus.java
##
@@ -43,17 +44,79 @@
  */
 @SuppressWarnings("unused")
 public class ServiceStatus {
+  public static final String STATUS_DESCRIPTION_NONE = "None";
+  public static final String STATUS_DESCRIPTION_INIT = "Init";
+  public static final String STATUS_DESCRIPTION_STARTED = "Started";
+  public static final String STATUS_DESCRIPTION_NO_HELIX_STATE = "Helix state 
does not exist";
   private static final Logger LOGGER = 
LoggerFactory.getLogger(ServiceStatus.class);
+  private static final int MAX_RESOURCE_NAMES_TO_LOG = 5;
+  private static final Map 
serviceStatusCallbackMap = new ConcurrentHashMap<>();
+  private static final ServiceStatusCallback serviceStatusCallback =
+  new 
MapBasedMultipleCallbackServiceStatusCallback(serviceStatusCallbackMap);
 
-  public enum Status {
-STARTING, GOOD, BAD
+  public static void setServiceStatusCallback(String name, 
ServiceStatusCallback serviceStatusCallback) {
+ServiceStatus.serviceStatusCallbackMap.put(name, serviceStatusCallback);
   }
 
-  public static final String STATUS_DESCRIPTION_NONE = "None";
-  public static final String STATUS_DESCRIPTION_INIT = "Init";
-  public static final String STATUS_DESCRIPTION_NO_HELIX_STATE = "Helix state 
does not exist";
+  public static void removeServiceStatusCallback(String name) {
+ServiceStatus.serviceStatusCallbackMap.remove(name);
+  }
 
-  private static final int MAX_RESOURCE_NAMES_TO_LOG = 5;
+  public static Status getServiceStatus() {
+return getServiceStatus(serviceStatusCallback);
+  }
+
+  public static Status getServiceStatus(String name) {
+if (serviceStatusCallbackMap.containsKey(name)) {
+  return getServiceStatus(serviceStatusCallbackMap.get(name));
+} else {
+  return Status.NOT_STARTED;
+}
+  }
+
+  private static Status getServiceStatus(ServiceStatusCallback callback) {
+try {
+  return callback.getServiceStatus();
+} catch (Exception e) {
+  LOGGER.warn("Caught exception while reading the service status", e);
+  return Status.BAD;
+}
+  }
+
+  public static String getStatusDescription() {
+return getStatusDescription(serviceStatusCallback);
+  }
+
+  public static String getStatusDescription(String name) {
+if (serviceStatusCallbackMap.containsKey(name)) {
+  return getStatusDescription(serviceStatusCallbackMap.get(name));
+} else {
+  return STATUS_DESCRIPTION_NONE;
+}
+  }
+
+  private static String getStatusDescription(ServiceStatusCallback callback) {
+try {
+  return callback.getStatusDescription();
+} catch (Exception e) {
+  return "Exception: " + e.getMessage();

Review comment:
   done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org



[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5266: Add PinotServiceManager to start Pinot components

2020-05-22 Thread GitBox


fx19880617 commented on a change in pull request #5266:
URL: https://github.com/apache/incubator-pinot/pull/5266#discussion_r429119690



##
File path: 
pinot-tools/src/main/java/org/apache/pinot/tools/service/api/resources/PinotServiceManagerInstanceResource.java
##
@@ -0,0 +1,241 @@
+/**
+ * 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.pinot.tools.service.api.resources;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.inject.Inject;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.pinot.common.utils.CommonConstants;
+import org.apache.pinot.common.utils.NetUtil;
+import org.apache.pinot.controller.ControllerConf;
+import org.apache.pinot.spi.services.ServiceRole;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.tools.service.PinotServiceManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static 
org.apache.pinot.common.utils.CommonConstants.Controller.CONFIG_OF_CONTROLLER_METRICS_PREFIX;
+import static 
org.apache.pinot.common.utils.CommonConstants.Controller.DEFAULT_METRICS_PREFIX;
+import static org.apache.pinot.tools.utils.PinotConfigUtils.TMP_DIR;
+import static org.apache.pinot.tools.utils.PinotConfigUtils.getAvailablePort;
+
+
+@Api(tags = "Startable")
+@Path("/")
+public class PinotServiceManagerInstanceResource {
+
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(PinotServiceManagerInstanceResource.class);
+
+  @Inject
+  private PinotServiceManager _pinotServiceManager;
+
+  @GET
+  @Produces(MediaType.APPLICATION_JSON)
+  @Path("/instances")
+  @ApiOperation(value = "Get Pinot Instances Status")
+  @ApiResponses(value = {@ApiResponse(code = 200, message = "Instance 
Status"), @ApiResponse(code = 500, message = "Internal server error")})
+  public Map getPinotAllInstancesStatus() {
+Map results = new HashMap<>();
+for (String instanceId : _pinotServiceManager.getRunningInstanceIds()) {
+  results.put(instanceId, 
_pinotServiceManager.getInstanceStatus(instanceId));
+}
+return results;
+  }
+
+  @GET
+  @Produces(MediaType.APPLICATION_JSON)
+  @Path("/instances/{instanceName}")
+  @ApiOperation(value = "Get Pinot Instance Status")
+  @ApiResponses(value = {@ApiResponse(code = 200, message = "Instance 
Status"), @ApiResponse(code = 404, message = "Instance Not Found"), 
@ApiResponse(code = 500, message = "Internal server error")})
+  public PinotInstanceStatus getPinotInstanceStatus(
+  @ApiParam(value = "Name of the instance") @PathParam("instanceName") 
String instanceName) {
+List instanceIds = _pinotServiceManager.getRunningInstanceIds();
+if (instanceIds.contains(instanceName)) {
+  return _pinotServiceManager.getInstanceStatus(instanceName);
+}
+throw new WebApplicationException(String.format("Instance [%s] not 
found.", instanceName),
+Response.Status.NOT_FOUND);
+  }
+
+  @DELETE

Review comment:
   added `stopAllPinotInstances` and `stopPinotInstancesByRole`





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org



[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5266: Add PinotServiceManager to start Pinot components

2020-05-22 Thread GitBox


fx19880617 commented on a change in pull request #5266:
URL: https://github.com/apache/incubator-pinot/pull/5266#discussion_r429111535



##
File path: 
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/StartServiceManagerCommand.java
##
@@ -0,0 +1,213 @@
+/**
+ * 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.pinot.tools.admin.command;
+
+import java.io.File;
+import java.net.SocketException;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.commons.configuration.Configuration;
+import org.apache.pinot.common.utils.CommonConstants;
+import org.apache.pinot.controller.ControllerConf;
+import org.apache.pinot.spi.services.ServiceRole;
+import org.apache.pinot.tools.Command;
+import org.apache.pinot.tools.service.PinotServiceManager;
+import org.apache.pinot.tools.utils.PinotConfigUtils;
+import org.kohsuke.args4j.Option;
+import org.kohsuke.args4j.spi.StringArrayOptionHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static 
org.apache.pinot.common.utils.CommonConstants.Helix.PINOT_SERVICE_ROLE;
+
+
+/**
+ * Class to implement StartPinotService command.
+ *
+ */
+public class StartServiceManagerCommand extends AbstractBaseAdminCommand 
implements Command {

Review comment:
   added examples

##
File path: 
pinot-tools/src/main/java/org/apache/pinot/tools/service/api/resources/PinotServiceManagerInstanceResource.java
##
@@ -0,0 +1,241 @@
+/**
+ * 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.pinot.tools.service.api.resources;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.inject.Inject;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.pinot.common.utils.CommonConstants;
+import org.apache.pinot.common.utils.NetUtil;
+import org.apache.pinot.controller.ControllerConf;
+import org.apache.pinot.spi.services.ServiceRole;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.tools.service.PinotServiceManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static 
org.apache.pinot.common.utils.CommonConstants.Controller.CONFIG_OF_CONTROLLER_METRICS_PREFIX;

Review comment:
   done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.a

[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5266: Add PinotServiceManager to start Pinot components

2020-05-22 Thread GitBox


fx19880617 commented on a change in pull request #5266:
URL: https://github.com/apache/incubator-pinot/pull/5266#discussion_r429111007



##
File path: 
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/StartServiceManagerCommand.java
##
@@ -0,0 +1,213 @@
+/**
+ * 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.pinot.tools.admin.command;
+
+import java.io.File;
+import java.net.SocketException;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.commons.configuration.Configuration;
+import org.apache.pinot.common.utils.CommonConstants;
+import org.apache.pinot.controller.ControllerConf;
+import org.apache.pinot.spi.services.ServiceRole;
+import org.apache.pinot.tools.Command;
+import org.apache.pinot.tools.service.PinotServiceManager;
+import org.apache.pinot.tools.utils.PinotConfigUtils;
+import org.kohsuke.args4j.Option;
+import org.kohsuke.args4j.spi.StringArrayOptionHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static 
org.apache.pinot.common.utils.CommonConstants.Helix.PINOT_SERVICE_ROLE;
+
+
+/**
+ * Class to implement StartPinotService command.
+ *
+ */
+public class StartServiceManagerCommand extends AbstractBaseAdminCommand 
implements Command {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(StartServiceManagerCommand.class);
+  private final List _bootstrapConfigurations = new 
ArrayList<>();
+  private final String[] BOOTSTRAP_SERVICES = new String[]{"CONTROLLER", 
"BROKER", "SERVER"};
+
+  @Option(name = "-help", required = false, help = true, aliases = {"-h", 
"--h", "--help"}, usage = "Print this message.")
+  private boolean _help;
+  @Option(name = "-zkAddress", required = true, metaVar = "", usage = 
"Http address of Zookeeper.")
+  private String _zkAddress = DEFAULT_ZK_ADDRESS;
+  @Option(name = "-clusterName", required = true, metaVar = "", usage 
= "Pinot cluster name.")
+  private String _clusterName = DEFAULT_CLUSTER_NAME;
+  @Option(name = "-port", required = true, metaVar = "", usage = "Pinot 
service manager admin port, -1 means disable, 0 means a random available port.")

Review comment:
   it's in `PinotServiceManager`

##
File path: 
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/EnumArrayOptionHandler.java
##
@@ -0,0 +1,67 @@
+/**
+ * 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.pinot.tools.admin.command;
+
+import org.kohsuke.args4j.CmdLineException;
+import org.kohsuke.args4j.CmdLineParser;
+import org.kohsuke.args4j.OptionDef;
+import org.kohsuke.args4j.spi.OptionHandler;
+import org.kohsuke.args4j.spi.Parameters;
+import org.kohsuke.args4j.spi.Setter;
+
+
+public class EnumArrayOptionHandler> extends 
OptionHandler {

Review comment:
   this is not used. will delete 

##
File path: 
pinot-tools/src/main/java/org/apache/pinot/tools/service/PinotServiceManagerAdminApiApplication.java
##
@@ -0,0 +1,89 @@
+/**
+ * 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