refactor(forest): 增加b12集群配置

This commit is contained in:
2023-12-07 14:48:03 +08:00
parent 99ae603f69
commit a101b5adba
3 changed files with 29 additions and 12 deletions

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-b12")
public interface B12LauncherService extends LauncherService{
}

View File

@@ -8,6 +8,12 @@ import com.dtflys.forest.annotation.Query;
* @date 2023-06-06 * @date 2023-06-06
*/ */
public interface LauncherService { public interface LauncherService {
@Get("/launcher/synchronizer/start")
void syncStart(Long flinkJobId);
@Get("/launcher/synchronizer/stop")
void syncStop(Long flinkJobId);
@Get("/launcher/compaction/stop") @Get("/launcher/compaction/stop")
void compactionStop(@Query("flink_job_id") Long flinkJobId, @Query("alias") String alias); void compactionStop(@Query("flink_job_id") Long flinkJobId, @Query("alias") String alias);

View File

@@ -2,6 +2,8 @@ package com.lanyuanxiaoyao.service.forest.service.launcher;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.eshore.odcp.hudi.connector.Constants; import com.eshore.odcp.hudi.connector.Constants;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.collections.api.factory.Maps; import org.eclipse.collections.api.factory.Maps;
import org.eclipse.collections.api.list.ImmutableList; import org.eclipse.collections.api.list.ImmutableList;
import org.eclipse.collections.api.map.ImmutableMap; import org.eclipse.collections.api.map.ImmutableMap;
@@ -23,18 +25,16 @@ public class LaunchersService {
A4LauncherService a4LauncherService, A4LauncherService a4LauncherService,
B1LauncherService b1LauncherService, B1LauncherService b1LauncherService,
B5LauncherService b5LauncherService, B5LauncherService b5LauncherService,
B5SyncLauncherService b5SyncLauncherService B5SyncLauncherService b5SyncLauncherService,
B12LauncherService b12LauncherService
) { ) {
serviceMap = Maps.immutable.of( Map<String, LauncherService> map = new HashMap<>(5);
Constants.CLUSTER_A4, map.put(Constants.CLUSTER_A4, a4LauncherService);
a4LauncherService, map.put(Constants.CLUSTER_B1, b1LauncherService);
Constants.CLUSTER_B1, map.put(Constants.CLUSTER_B5, b5LauncherService);
b1LauncherService, map.put(Constants.CLUSTER_B5_SYNC, b5SyncLauncherService);
Constants.CLUSTER_B5, map.put(Constants.CLUSTER_B12, b12LauncherService);
b5LauncherService, serviceMap = Maps.immutable.ofAll(map);
Constants.CLUSTER_B5_SYNC,
b5SyncLauncherService
);
} }
private LauncherService getService(String cluster) { private LauncherService getService(String cluster) {