feature(cli,forest): 增加b5sync集群调度

为同步程序上服务准备,不在服务级别区分同步和压缩的调度
This commit is contained in:
2023-07-11 10:37:33 +08:00
parent 1b591dff6d
commit f0881d65d7
8 changed files with 65 additions and 30 deletions

View File

@@ -6,6 +6,6 @@ import com.dtflys.forest.annotation.BaseRequest;
* @author lanyuanxiaoyao
* @date 2023-06-06
*/
@BaseRequest(baseURL = "http://service-launcher-compaction-a4")
@BaseRequest(baseURL = "http://service-launcher-runner-a4")
public interface A4LauncherService extends LauncherService{
}

View File

@@ -8,6 +8,6 @@ import com.dtflys.forest.annotation.Query;
* @author lanyuanxiaoyao
* @date 2023-06-06
*/
@BaseRequest(baseURL = "http://service-launcher-compaction-b1")
@BaseRequest(baseURL = "http://service-launcher-runner-b1")
public interface B1LauncherService extends LauncherService{
}

View File

@@ -6,6 +6,6 @@ import com.dtflys.forest.annotation.BaseRequest;
* @author lanyuanxiaoyao
* @date 2023-06-06
*/
@BaseRequest(baseURL = "http://service-launcher-compaction-b5")
@BaseRequest(baseURL = "http://service-launcher-runner-b5")
public interface B5LauncherService extends LauncherService{
}

View File

@@ -0,0 +1,11 @@
package com.lanyuanxiaoyao.service.forest.service.launcher;
import com.dtflys.forest.annotation.BaseRequest;
/**
* @author lanyuanxiaoyao
* @date 2023-06-06
*/
@BaseRequest(baseURL = "http://service-launcher-runner-b5-sync")
public interface B5SyncLauncherService extends LauncherService{
}

View File

@@ -8,9 +8,9 @@ import com.dtflys.forest.annotation.Query;
* @date 2023-06-06
*/
public interface LauncherService {
@Get("/compaction/stop")
void stop(@Query("flink_job_id") Long flinkJobId, @Query("alias") String alias);
@Get("/launcher/compaction/stop")
void compactionStop(@Query("flink_job_id") Long flinkJobId, @Query("alias") String alias);
@Get("/compaction/stop_app")
void stopApp(@Query("application_id") String applicationId);
@Get("/launcher/compaction/stop_app")
void compactionStopApp(@Query("application_id") String applicationId);
}

View File

@@ -22,15 +22,18 @@ public class LaunchersService {
public LaunchersService(
A4LauncherService a4LauncherService,
B1LauncherService b1LauncherService,
B5LauncherService b5LauncherService
) {
B5LauncherService b5LauncherService,
B5SyncLauncherService b5SyncLauncherService
) {
serviceMap = Maps.immutable.of(
Constants.CLUSTER_A4,
a4LauncherService,
Constants.CLUSTER_B1,
b1LauncherService,
Constants.CLUSTER_B5,
b5LauncherService
b5LauncherService,
Constants.CLUSTER_B5_SYNC,
b5SyncLauncherService
);
}
@@ -45,25 +48,25 @@ public class LaunchersService {
return serviceMap.valuesView().toList().toImmutable();
}
public void stop(Long flinkJobId, String alias) {
public void compactionStop(Long flinkJobId, String alias) {
for (LauncherService service : getServices()) {
service.stop(flinkJobId, alias);
service.compactionStop(flinkJobId, alias);
}
}
public void stop(String cluster, Long flinkJobId, String alias) {
public void compactionStop(String cluster, Long flinkJobId, String alias) {
LauncherService service = getService(cluster);
service.stop(flinkJobId, alias);
service.compactionStop(flinkJobId, alias);
}
public void stopApp(String applicationId) {
public void compactionStopApp(String applicationId) {
for (LauncherService service : getServices()) {
service.stopApp(applicationId);
service.compactionStopApp(applicationId);
}
}
public void stopApp(String cluster, String applicationId) {
public void compactionStopApp(String cluster, String applicationId) {
LauncherService service = getService(cluster);
service.stopApp(applicationId);
service.compactionStopApp(applicationId);
}
}