Skip to content

Commit

Permalink
[Optimization][dinky-admin] Check if the cluster is disabled before s…
Browse files Browse the repository at this point in the history
…tarting the flink session. (#4270)

Co-authored-by: yuhang2.zhang <yuhang2.zhang@ly.com>
Co-authored-by: GH Action - Upstream Sync <action@github.com>
  • Loading branch information
3 people authored Mar 1, 2025
1 parent 13d7df9 commit 11e2971
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public List<ClusterConfiguration> listAllClusterConfig() {
public FlinkClusterConfig getAndCheckEnableFlinkClusterCfg(Integer id) {
ClusterConfiguration cfg = this.getClusterConfigById(id);
DinkyAssert.checkNull(cfg, "The clusterConfiguration not exists!");
DinkyAssert.checkEnable(cfg, "The clusterConfiguration is Disable!");
DinkyAssert.checkEnable(cfg, "The cluster is Disable!");
return FlinkClusterConfig.create(cfg.getType(), cfg.getConfigJson());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.dinky.data.model.Task;
import org.dinky.gateway.config.FlinkConfig;
import org.dinky.gateway.config.GatewayConfig;
import org.dinky.gateway.exception.GatewayException;
import org.dinky.gateway.model.FlinkClusterConfig;
import org.dinky.gateway.result.GatewayResult;
import org.dinky.job.JobConfig;
Expand Down Expand Up @@ -230,9 +229,8 @@ public void killCluster(Integer id) {
@Override
public ClusterInstance deploySessionCluster(Integer id) {
ClusterConfiguration clusterCfg = clusterConfigurationService.getClusterConfigById(id);
if (Asserts.isNull(clusterCfg)) {
throw new GatewayException("The cluster configuration does not exist.");
}
DinkyAssert.checkNull(clusterCfg, "The clusterConfiguration not exists!");
DinkyAssert.checkEnable(clusterCfg, "The cluster is Disable!");

// add custom configuration.
FlinkConfig flinkConfig = clusterCfg.getConfigJson().getFlinkConfig();
Expand Down

0 comments on commit 11e2971

Please sign in to comment.