You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by GitBox <gi...@apache.org> on 2019/12/27 08:34:50 UTC

[GitHub] [submarine] liuxunorg opened a new pull request #133: SUBMARINE-324. Submarine cluster status RESTful

liuxunorg opened a new pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133
 
 
   ### What is this PR for?
   Now, the submarine server supports cluster function,
   You can get the status of multiple submarine servers and interpreter processes.
   Now provides a REST interface that provides external access to cluster status information.
   Provides diagnostics of cluster status for submarine operators.
   
   
   ### What type of PR is it?
   Feature
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   * https://issues.apache.org/jira/browse/SUBMARINE-324
   
   
   ### How should this be tested?
   * [CI Pass](https://travis-ci.org/liuxunorg/submarine/builds/629923676)
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] liuxunorg commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
liuxunorg commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133#discussion_r361646702
 
 

 ##########
 File path: submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/ClusterRestApi.java
 ##########
 @@ -0,0 +1,236 @@
+/*
+ * 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.submarine.server.rest;
+
+import com.google.gson.Gson;
+import org.apache.submarine.commons.cluster.ClusterServer;
+import org.apache.submarine.commons.cluster.meta.ClusterMeta;
+import org.apache.submarine.commons.cluster.meta.ClusterMetaType;
+import org.apache.submarine.commons.utils.SubmarineConfiguration;
+import org.apache.submarine.server.response.JsonResponse;
+import org.apache.submarine.server.workbench.annotation.SubmarineApi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * clusters Rest api.
+ */
+@Path(RestConstants.V1 + "/" + RestConstants.CLUSTER)
+@Produces("application/json")
+public class ClusterRestApi {
+  private static final Logger LOG = LoggerFactory.getLogger(ClusterRestApi.class);
+  Gson gson = new Gson();
+
+  private ClusterServer clusterServer = ClusterServer.getInstance();
+
+  // Do not modify, Use by `zeppelin-web/src/app/cluster/cluster.html`
 
 Review comment:
   Description of error.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133#discussion_r361627316
 
 

 ##########
 File path: submarine-server/server-core/src/test/java/org/apache/submarine/server/SubmarineServerClusterTest.java
 ##########
 @@ -104,4 +118,82 @@ public void testGetServerClusterMeta() {
     assertEquals(hashMap.size(), 1);
     LOG.info("SubmarineServerClusterTest::testGetServerClusterMeta <<<");
   }
+
+  @Test
+  public void testGetClusterAddress() throws IOException {
+    GetMethod response = httpGet("/api/" + RestConstants.V1 + "/"
+        + RestConstants.CLUSTER + "/" + RestConstants.ADDRESS);
+    LOG.info(response.toString());
+
+    String requestBody = response.getResponseBodyAsString();
+    LOG.info(requestBody);
+
+    Type type = new TypeToken<JsonResponse<List<String>>>() {}.getType();
+    Gson gson = new Gson();
+    JsonResponse<List<String>> jsonResponse = gson.fromJson(requestBody, type);
+    LOG.info(jsonResponse.getResult().toString());
+    assertEquals(jsonResponse.getCode(), Response.Status.OK.getStatusCode());
+
+    List<String> listAddr = jsonResponse.getResult();
+    LOG.info("listAddr.size = {}", listAddr.size());
+    assertEquals(listAddr.size(), 1);
+  }
+
+  private ArrayList<HashMap<String, Object>> getClusterNodes() throws IOException {
+    GetMethod response = httpGet("/api/" + RestConstants.V1 + "/"
+        + RestConstants.CLUSTER + "/" + RestConstants.NODES);
+    LOG.info(response.toString());
+
+    String requestBody = response.getResponseBodyAsString();
+    LOG.info(requestBody);
+
+    Type type = new TypeToken<JsonResponse<ArrayList<HashMap<String, Object>>>>() {}.getType();
+    Gson gson = new Gson();
+    JsonResponse<ArrayList<HashMap<String, Object>>> jsonResponse = gson.fromJson(requestBody, type);
+    LOG.info(jsonResponse.getResult().toString());
+    assertEquals(jsonResponse.getCode(), Response.Status.OK.getStatusCode());
+
+    ArrayList<HashMap<String, Object>> listNodes = jsonResponse.getResult();
+    LOG.info("listNodes.size = {}", listNodes.size());
+    assertEquals(listNodes.size(), 1);
+
+    return listNodes;
+  }
+
+  @Test
+  public void testGetClusterNodes() throws IOException {
 
 Review comment:
   I'm not sure if we need to run testGetClusterNodes() again. As testGetClusterNode calls getClusterNodes and it contains assertion like "assertEquals(listNodes.size(), 1);"

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] liuxunorg commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
liuxunorg commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133#discussion_r361647349
 
 

 ##########
 File path: submarine-server/server-core/src/test/java/org/apache/submarine/server/SubmarineServerClusterTest.java
 ##########
 @@ -104,4 +118,82 @@ public void testGetServerClusterMeta() {
     assertEquals(hashMap.size(), 1);
     LOG.info("SubmarineServerClusterTest::testGetServerClusterMeta <<<");
   }
+
+  @Test
+  public void testGetClusterAddress() throws IOException {
+    GetMethod response = httpGet("/api/" + RestConstants.V1 + "/"
+        + RestConstants.CLUSTER + "/" + RestConstants.ADDRESS);
+    LOG.info(response.toString());
+
+    String requestBody = response.getResponseBodyAsString();
+    LOG.info(requestBody);
+
+    Type type = new TypeToken<JsonResponse<List<String>>>() {}.getType();
+    Gson gson = new Gson();
+    JsonResponse<List<String>> jsonResponse = gson.fromJson(requestBody, type);
+    LOG.info(jsonResponse.getResult().toString());
+    assertEquals(jsonResponse.getCode(), Response.Status.OK.getStatusCode());
+
+    List<String> listAddr = jsonResponse.getResult();
+    LOG.info("listAddr.size = {}", listAddr.size());
+    assertEquals(listAddr.size(), 1);
+  }
+
+  private ArrayList<HashMap<String, Object>> getClusterNodes() throws IOException {
+    GetMethod response = httpGet("/api/" + RestConstants.V1 + "/"
+        + RestConstants.CLUSTER + "/" + RestConstants.NODES);
+    LOG.info(response.toString());
+
+    String requestBody = response.getResponseBodyAsString();
+    LOG.info(requestBody);
+
+    Type type = new TypeToken<JsonResponse<ArrayList<HashMap<String, Object>>>>() {}.getType();
+    Gson gson = new Gson();
+    JsonResponse<ArrayList<HashMap<String, Object>>> jsonResponse = gson.fromJson(requestBody, type);
+    LOG.info(jsonResponse.getResult().toString());
+    assertEquals(jsonResponse.getCode(), Response.Status.OK.getStatusCode());
+
+    ArrayList<HashMap<String, Object>> listNodes = jsonResponse.getResult();
+    LOG.info("listNodes.size = {}", listNodes.size());
+    assertEquals(listNodes.size(), 1);
+
+    return listNodes;
+  }
+
+  @Test
+  public void testGetClusterNodes() throws IOException {
 
 Review comment:
   SubmarineServerClusterTest.java has only one submarine server node, so it will always only return 1 through the RESTful interface

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133#discussion_r361623875
 
 

 ##########
 File path: submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/ClusterRestApi.java
 ##########
 @@ -0,0 +1,236 @@
+/*
+ * 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.submarine.server.rest;
+
+import com.google.gson.Gson;
+import org.apache.submarine.commons.cluster.ClusterServer;
+import org.apache.submarine.commons.cluster.meta.ClusterMeta;
+import org.apache.submarine.commons.cluster.meta.ClusterMetaType;
+import org.apache.submarine.commons.utils.SubmarineConfiguration;
+import org.apache.submarine.server.response.JsonResponse;
+import org.apache.submarine.server.workbench.annotation.SubmarineApi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * clusters Rest api.
+ */
+@Path(RestConstants.V1 + "/" + RestConstants.CLUSTER)
+@Produces("application/json")
+public class ClusterRestApi {
+  private static final Logger LOG = LoggerFactory.getLogger(ClusterRestApi.class);
+  Gson gson = new Gson();
+
+  private ClusterServer clusterServer = ClusterServer.getInstance();
+
+  // Do not modify, Use by `zeppelin-web/src/app/cluster/cluster.html`
+  public static String PROPERTIES = "properties";
+
+  @GET
+  @Path("/" + RestConstants.ADDRESS)
+  @SubmarineApi
+  public Response getClusterAddress() {
+    SubmarineConfiguration sConf = SubmarineConfiguration.getInstance();
+    String clusterAddr = sConf.getClusterAddress();
+    String[] arrAddr = clusterAddr.split(",");
+    List<String> listAddr = Arrays.asList(arrAddr);
+
+    return new JsonResponse.Builder<List<String>>(Response.Status.OK)
+        .success(true).result(listAddr).build();
+  }
+
+  /**
+   * get all nodes of clusters
+   */
+  @GET
+  @Path("/" + RestConstants.NODES)
+  @SubmarineApi
+  public Response getClusterNodes(){
+    ArrayList<HashMap<String, Object>> nodes = new ArrayList<>();
+
+    Map<String, HashMap<String, Object>> clusterMeta = null;
+    Map<String, HashMap<String, Object>> intpMeta = null;
+    clusterMeta = clusterServer.getClusterMeta(ClusterMetaType.SERVER_META, "");
+    intpMeta = clusterServer.getClusterMeta(ClusterMetaType.INTP_PROCESS_META, "");
+
+    // Number of calculation processes
 
 Review comment:
   I'm not sure what's the meaning of the comment. Maybe "Loop through the calculation processes"  ?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133#discussion_r361627316
 
 

 ##########
 File path: submarine-server/server-core/src/test/java/org/apache/submarine/server/SubmarineServerClusterTest.java
 ##########
 @@ -104,4 +118,82 @@ public void testGetServerClusterMeta() {
     assertEquals(hashMap.size(), 1);
     LOG.info("SubmarineServerClusterTest::testGetServerClusterMeta <<<");
   }
+
+  @Test
+  public void testGetClusterAddress() throws IOException {
+    GetMethod response = httpGet("/api/" + RestConstants.V1 + "/"
+        + RestConstants.CLUSTER + "/" + RestConstants.ADDRESS);
+    LOG.info(response.toString());
+
+    String requestBody = response.getResponseBodyAsString();
+    LOG.info(requestBody);
+
+    Type type = new TypeToken<JsonResponse<List<String>>>() {}.getType();
+    Gson gson = new Gson();
+    JsonResponse<List<String>> jsonResponse = gson.fromJson(requestBody, type);
+    LOG.info(jsonResponse.getResult().toString());
+    assertEquals(jsonResponse.getCode(), Response.Status.OK.getStatusCode());
+
+    List<String> listAddr = jsonResponse.getResult();
+    LOG.info("listAddr.size = {}", listAddr.size());
+    assertEquals(listAddr.size(), 1);
+  }
+
+  private ArrayList<HashMap<String, Object>> getClusterNodes() throws IOException {
+    GetMethod response = httpGet("/api/" + RestConstants.V1 + "/"
+        + RestConstants.CLUSTER + "/" + RestConstants.NODES);
+    LOG.info(response.toString());
+
+    String requestBody = response.getResponseBodyAsString();
+    LOG.info(requestBody);
+
+    Type type = new TypeToken<JsonResponse<ArrayList<HashMap<String, Object>>>>() {}.getType();
+    Gson gson = new Gson();
+    JsonResponse<ArrayList<HashMap<String, Object>>> jsonResponse = gson.fromJson(requestBody, type);
+    LOG.info(jsonResponse.getResult().toString());
+    assertEquals(jsonResponse.getCode(), Response.Status.OK.getStatusCode());
+
+    ArrayList<HashMap<String, Object>> listNodes = jsonResponse.getResult();
+    LOG.info("listNodes.size = {}", listNodes.size());
+    assertEquals(listNodes.size(), 1);
+
+    return listNodes;
+  }
+
+  @Test
+  public void testGetClusterNodes() throws IOException {
 
 Review comment:
   I'm not sure we need to run testGetClusterNodes() again. As testGetClusterNode calls getClusterNodes and it contains assertion like "assertEquals(listNodes.size(), 1);"

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133#discussion_r361621136
 
 

 ##########
 File path: submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/ClusterRestApi.java
 ##########
 @@ -0,0 +1,236 @@
+/*
+ * 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.submarine.server.rest;
+
+import com.google.gson.Gson;
+import org.apache.submarine.commons.cluster.ClusterServer;
+import org.apache.submarine.commons.cluster.meta.ClusterMeta;
+import org.apache.submarine.commons.cluster.meta.ClusterMetaType;
+import org.apache.submarine.commons.utils.SubmarineConfiguration;
+import org.apache.submarine.server.response.JsonResponse;
+import org.apache.submarine.server.workbench.annotation.SubmarineApi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * clusters Rest api.
+ */
+@Path(RestConstants.V1 + "/" + RestConstants.CLUSTER)
+@Produces("application/json")
+public class ClusterRestApi {
+  private static final Logger LOG = LoggerFactory.getLogger(ClusterRestApi.class);
+  Gson gson = new Gson();
+
+  private ClusterServer clusterServer = ClusterServer.getInstance();
+
+  // Do not modify, Use by `zeppelin-web/src/app/cluster/cluster.html`
 
 Review comment:
   Use by "zeppelin-web"?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] liuxunorg commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
liuxunorg commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133#discussion_r361646892
 
 

 ##########
 File path: submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/ClusterRestApi.java
 ##########
 @@ -0,0 +1,236 @@
+/*
+ * 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.submarine.server.rest;
+
+import com.google.gson.Gson;
+import org.apache.submarine.commons.cluster.ClusterServer;
+import org.apache.submarine.commons.cluster.meta.ClusterMeta;
+import org.apache.submarine.commons.cluster.meta.ClusterMetaType;
+import org.apache.submarine.commons.utils.SubmarineConfiguration;
+import org.apache.submarine.server.response.JsonResponse;
+import org.apache.submarine.server.workbench.annotation.SubmarineApi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * clusters Rest api.
+ */
+@Path(RestConstants.V1 + "/" + RestConstants.CLUSTER)
+@Produces("application/json")
+public class ClusterRestApi {
+  private static final Logger LOG = LoggerFactory.getLogger(ClusterRestApi.class);
+  Gson gson = new Gson();
+
+  private ClusterServer clusterServer = ClusterServer.getInstance();
+
+  // Do not modify, Use by `zeppelin-web/src/app/cluster/cluster.html`
+  public static String PROPERTIES = "properties";
+
+  @GET
+  @Path("/" + RestConstants.ADDRESS)
+  @SubmarineApi
+  public Response getClusterAddress() {
+    SubmarineConfiguration sConf = SubmarineConfiguration.getInstance();
+    String clusterAddr = sConf.getClusterAddress();
+    String[] arrAddr = clusterAddr.split(",");
+    List<String> listAddr = Arrays.asList(arrAddr);
+
+    return new JsonResponse.Builder<List<String>>(Response.Status.OK)
+        .success(true).result(listAddr).build();
+  }
+
+  /**
+   * get all nodes of clusters
+   */
+  @GET
+  @Path("/" + RestConstants.NODES)
+  @SubmarineApi
+  public Response getClusterNodes(){
+    ArrayList<HashMap<String, Object>> nodes = new ArrayList<>();
+
+    Map<String, HashMap<String, Object>> clusterMeta = null;
+    Map<String, HashMap<String, Object>> intpMeta = null;
+    clusterMeta = clusterServer.getClusterMeta(ClusterMetaType.SERVER_META, "");
+    intpMeta = clusterServer.getClusterMeta(ClusterMetaType.INTP_PROCESS_META, "");
+
+    // Number of calculation processes
 
 Review comment:
   Description of error.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
yuanzac commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133#discussion_r361625850
 
 

 ##########
 File path: submarine-server/server-core/src/test/java/org/apache/submarine/server/rest/MetaStoreApiTest.java
 ##########
 @@ -42,7 +42,7 @@
 import static org.junit.Assert.assertTrue;
 
 public class MetaStoreApiTest {
 
 Review comment:
   It's better to rename MetaStoreApiTest to MetaStoreRestApiTest 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] asfgit closed pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] liuxunorg commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful

Posted by GitBox <gi...@apache.org>.
liuxunorg commented on a change in pull request #133: SUBMARINE-324. Submarine cluster status RESTful
URL: https://github.com/apache/submarine/pull/133#discussion_r361647043
 
 

 ##########
 File path: submarine-server/server-core/src/test/java/org/apache/submarine/server/rest/MetaStoreApiTest.java
 ##########
 @@ -42,7 +42,7 @@
 import static org.junit.Assert.assertTrue;
 
 public class MetaStoreApiTest {
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org