You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/11/03 13:37:41 UTC
[GitHub] [incubator-pinot] npawar commented on a change in pull request #6211: [WIP] add api for cluster manager to get table state
npawar commented on a change in pull request #6211:
URL: https://github.com/apache/incubator-pinot/pull/6211#discussion_r516168685
##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
##########
@@ -1981,6 +1981,16 @@ public boolean hasRealtimeTable(String tableName) {
return hasTable(TableNameBuilder.REALTIME.tableNameWithType(tableName));
}
+ /**
+ * Gets the current state of the table
+ * @param tableNameWithType Table name with suffix
+ * @return String enabled | disabled
+ */
Review comment:
Let's keep this method's return type a boolean - `isTableEnabled`.
##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
##########
@@ -1981,6 +1981,16 @@ public boolean hasRealtimeTable(String tableName) {
return hasTable(TableNameBuilder.REALTIME.tableNameWithType(tableName));
}
+ /**
+ * Gets the current state of the table
Review comment:
current state" has a different meaning in helix/pinot. I would suggest saying something about it being enabled ot not.
##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java
##########
@@ -558,4 +558,54 @@ public RebalanceResult rebalance(
throw new ControllerApplicationException(LOGGER, e.getMessage(), Response.Status.NOT_FOUND);
}
}
+
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/tables/{tableName}/state")
+ @ApiOperation(value = "Get current table state", notes = "Get current table state")
+ public String getTableState(
+ @ApiParam(value = "Name of the table to get its state", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "realtime|offline") @QueryParam("type") String tableTypeStr
Review comment:
Let's just make type as required, and keep return type binary, instead of introducing a json blurb here.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org