You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "s7monk (via GitHub)" <gi...@apache.org> on 2024/04/29 09:13:52 UTC
[PR] [Feature] Introduce cluster management interface [paimon-webui]
s7monk opened a new pull request, #200:
URL: https://github.com/apache/paimon-webui/pull/200
close: https://github.com/apache/paimon-webui/issues/199
### Purpose
Introduce a cluster management interface to facilitate the creation of cluster configurations for the computing engine on the system management page.
### Tests
ClusterControllerTest.
### API and Format
```
@RestController
@RequestMapping("/api/cluster")
public class ClusterController {
@Autowired private ClusterService clusterService;
@SaCheckPermission("system:cluster:query")
@GetMapping("/{id}")
public R<ClusterInfo> getCluster(@PathVariable("id") Integer id) {
ClusterInfo clusterInfo = clusterService.getById(id);
if (clusterInfo == null) {
return R.failed(Status.CLUSTER_NOT_EXIST);
}
return R.succeed(clusterInfo);
}
@SaCheckPermission("system:cluster:list")
@GetMapping("/list")
public PageR<ClusterInfo> listClusters(ClusterInfo clusterInfo) {
IPage<ClusterInfo> page = PageSupport.startPage();
List<ClusterInfo> clusterInfos = clusterService.listUsers(page, clusterInfo);
return PageR.<ClusterInfo>builder()
.success(true)
.total(page.getTotal())
.data(clusterInfos)
.build();
}
@SaCheckPermission("system:cluster:add")
@PostMapping
public R<Void> add(@Validated @RequestBody ClusterInfo clusterInfo) {
if (!clusterService.checkClusterNameUnique(clusterInfo)) {
return R.failed(Status.CLUSTER_NAME_ALREADY_EXISTS, clusterInfo.getClusterName());
}
return clusterService.save(clusterInfo) ? R.succeed() : R.failed();
}
@SaCheckPermission("system:cluster:update")
@PutMapping
public R<Void> update(@Validated @RequestBody ClusterInfo clusterInfo) {
if (!clusterService.checkClusterNameUnique(clusterInfo)) {
return R.failed(Status.CLUSTER_NAME_ALREADY_EXISTS, clusterInfo.getClusterName());
}
return clusterService.updateById(clusterInfo) ? R.succeed() : R.failed();
}
@SaCheckPermission("system:cluster:delete")
@DeleteMapping("/{clusterIds}")
public R<Void> delete(@PathVariable Integer[] clusterIds) {
return clusterService.deleteClusterByIds(clusterIds) > 0 ? R.succeed() : R.failed();
}
```
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce cluster management interface [paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas merged PR #200:
URL: https://github.com/apache/paimon-webui/pull/200
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce cluster management interface [paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #200:
URL: https://github.com/apache/paimon-webui/pull/200#discussion_r1590298638
##########
paimon-web-server/src/main/resources/i18n/messages_en_US.properties:
##########
@@ -51,3 +51,4 @@ table.drop.error=Exception calling Paimon Catalog API to drop a table.
table.rename.error=Exception calling Paimon Catalog API to rename a table.
cdc.job.exist.error=Paimon CDC job exists.
cdc.job.not.exist.error=Paimon CDC job is not exist.
+cluster.name.exist=The cluster name {0} already exists.
Review Comment:
```suggestion
cluster.name.exist=This cluster name {0} already exists.
```
To aligin the naming style of other name exist.
##########
paimon-web-server/src/main/resources/i18n/messages_zh_CN.properties:
##########
@@ -51,3 +51,4 @@ table.drop.error=\u8C03\u7528 Paimon API \u5220\u9664 Table \u65F6\u53D1\u751F\u
table.rename.error=\u8C03\u7528 Paimon API \u91CD\u547D\u540D Table \u65F6\u53D1\u751F\u5F02\u5E38
cdc.job.exist.error=paimon cdc\u4F5C\u4E1A\u5DF2\u5B58\u5728
cdc.job.not.exist.error=paimon cdc\u4F5C\u4E1A\u4E0D\u5B58\u5728
+cluster.name.exist=\u8BE5\u96C6\u7FA4\u540D{0}\u5DF2\u7ECF\u5B58\u5728
Review Comment:
Ditto.
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/result/enums/Status.java:
##########
@@ -77,8 +77,13 @@ public enum Status {
TABLE_DROP_ERROR(10510, "table.drop.error"),
TABLE_RENAME_ERROR(10511, "table.rename.error"),
+ /** ------------cdc-----------------. */
CDC_JOB_EXIST_ERROR(10601, "cdc.job.exist.error"),
- CDC_JOB_NO_EXIST_ERROR(10602, "cdc.job.not.exist.error");
+ CDC_JOB_NO_EXIST_ERROR(10602, "cdc.job.not.exist.error"),
+
+ /** ------------cluster-----------------. */
+ CLUSTER_NOT_EXIST(10701, "cluster.not.exist"),
Review Comment:
Any usage? If no, please remove this status.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce cluster management interface [paimon-webui]
Posted by "s7monk (via GitHub)" <gi...@apache.org>.
s7monk commented on code in PR #200:
URL: https://github.com/apache/paimon-webui/pull/200#discussion_r1590493182
##########
paimon-web-server/src/main/resources/i18n/messages_zh_CN.properties:
##########
@@ -51,3 +51,4 @@ table.drop.error=\u8C03\u7528 Paimon API \u5220\u9664 Table \u65F6\u53D1\u751F\u
table.rename.error=\u8C03\u7528 Paimon API \u91CD\u547D\u540D Table \u65F6\u53D1\u751F\u5F02\u5E38
cdc.job.exist.error=paimon cdc\u4F5C\u4E1A\u5DF2\u5B58\u5728
cdc.job.not.exist.error=paimon cdc\u4F5C\u4E1A\u4E0D\u5B58\u5728
+cluster.name.exist=\u8BE5\u96C6\u7FA4\u540D{0}\u5DF2\u7ECF\u5B58\u5728
Review Comment:
done.
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/result/enums/Status.java:
##########
@@ -77,8 +77,13 @@ public enum Status {
TABLE_DROP_ERROR(10510, "table.drop.error"),
TABLE_RENAME_ERROR(10511, "table.rename.error"),
+ /** ------------cdc-----------------. */
CDC_JOB_EXIST_ERROR(10601, "cdc.job.exist.error"),
- CDC_JOB_NO_EXIST_ERROR(10602, "cdc.job.not.exist.error");
+ CDC_JOB_NO_EXIST_ERROR(10602, "cdc.job.not.exist.error"),
+
+ /** ------------cluster-----------------. */
+ CLUSTER_NOT_EXIST(10701, "cluster.not.exist"),
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.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org