feat(configuration): 增加yarn集群的相关配置
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
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-a4")
|
||||
public interface A4LauncherService extends LauncherService{
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
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{
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
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")
|
||||
public interface B5LauncherService extends LauncherService{
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
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{
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.lanyuanxiaoyao.service.forest.service.launcher;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.eshore.odcp.hudi.connector.Constants;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnClusters;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.eclipse.collections.api.factory.Maps;
|
||||
@@ -9,6 +9,7 @@ import org.eclipse.collections.api.list.ImmutableList;
|
||||
import org.eclipse.collections.api.map.ImmutableMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -22,18 +23,15 @@ public class LaunchersService {
|
||||
private final ImmutableMap<String, LauncherService> serviceMap;
|
||||
|
||||
public LaunchersService(
|
||||
A4LauncherService a4LauncherService,
|
||||
B1LauncherService b1LauncherService,
|
||||
B5LauncherService b5LauncherService,
|
||||
B5SyncLauncherService b5SyncLauncherService,
|
||||
B12LauncherService b12LauncherService
|
||||
YarnClusters yarnClusters,
|
||||
ApplicationContext applicationContext
|
||||
) {
|
||||
Map<String, LauncherService> map = new HashMap<>(5);
|
||||
map.put(Constants.CLUSTER_A4, a4LauncherService);
|
||||
map.put(Constants.CLUSTER_B1, b1LauncherService);
|
||||
map.put(Constants.CLUSTER_B5, b5LauncherService);
|
||||
map.put(Constants.CLUSTER_B5_SYNC, b5SyncLauncherService);
|
||||
map.put(Constants.CLUSTER_B12, b12LauncherService);
|
||||
for (String cluster : yarnClusters.getActiveClusters()) {
|
||||
logger.info("Load {} cluster service", cluster);
|
||||
LauncherService service = applicationContext.getBean(StrUtil.format("{}LauncherService", StrUtil.toCamelCase(cluster)), LauncherService.class);
|
||||
map.put(cluster, service);
|
||||
}
|
||||
serviceMap = Maps.immutable.ofAll(map);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.lanyuanxiaoyao.service.forest.service.launcher.impl;
|
||||
|
||||
import com.dtflys.forest.annotation.BaseRequest;
|
||||
import com.lanyuanxiaoyao.service.forest.service.launcher.LauncherService;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@BaseRequest(baseURL = "http://service-launcher-runner-a4")
|
||||
public interface A4LauncherService extends LauncherService {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.lanyuanxiaoyao.service.forest.service.launcher.impl;
|
||||
|
||||
import com.dtflys.forest.annotation.BaseRequest;
|
||||
import com.lanyuanxiaoyao.service.forest.service.launcher.LauncherService;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@BaseRequest(baseURL = "http://service-launcher-runner-b12")
|
||||
public interface B12LauncherService extends LauncherService {
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.lanyuanxiaoyao.service.forest.service.launcher;
|
||||
package com.lanyuanxiaoyao.service.forest.service.launcher.impl;
|
||||
|
||||
import com.dtflys.forest.annotation.BaseRequest;
|
||||
import com.dtflys.forest.annotation.Get;
|
||||
import com.dtflys.forest.annotation.Query;
|
||||
import com.lanyuanxiaoyao.service.forest.service.launcher.LauncherService;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@BaseRequest(baseURL = "http://service-launcher-runner-b1")
|
||||
public interface B1LauncherService extends LauncherService{
|
||||
public interface B1LauncherService extends LauncherService {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.lanyuanxiaoyao.service.forest.service.launcher.impl;
|
||||
|
||||
import com.dtflys.forest.annotation.BaseRequest;
|
||||
import com.lanyuanxiaoyao.service.forest.service.launcher.LauncherService;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@BaseRequest(baseURL = "http://service-launcher-runner-b5")
|
||||
public interface B5LauncherService extends LauncherService {
|
||||
}
|
||||
Reference in New Issue
Block a user