Front end interaction optimization of adapter pool

pull/257/head
chen.ma 3 years ago
parent f705f3fd03
commit 92c93ab398

@ -115,6 +115,18 @@ public class ThreadPoolAdapterService {
return result;
}
public Set<String> queryThreadPoolKey(ThreadPoolAdapterReqDTO requestParameter) {
Map<String, Map<String, List<ThreadPoolAdapterState>>> threadPoolAdapterStateMap = THREAD_POOL_ADAPTER_MAP.get(requestParameter.getMark());
if (CollectionUtil.isNotEmpty(threadPoolAdapterStateMap)) {
String buildKey = requestParameter.getTenant() + IDENTIFY_SLICER_SYMBOL + requestParameter.getItem();
Map<String, List<ThreadPoolAdapterState>> actual = threadPoolAdapterStateMap.get(buildKey);
if (CollectionUtil.isNotEmpty(actual)) {
return actual.keySet();
}
}
return new HashSet();
}
public static void remove(String identify) {
synchronized (ThreadPoolAdapterService.class) {
THREAD_POOL_ADAPTER_MAP.values().forEach(each -> each.forEach((key, val) -> {

@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Set;
import static cn.hippo4j.common.constant.Constants.HTTP_EXECUTE_TIMEOUT;
import static cn.hippo4j.common.constant.Constants.REGISTER_ADAPTER_BASE_PATH;
@ -51,6 +52,12 @@ public class ThreadPoolAdapterController {
return Results.success(result);
}
@GetMapping(REGISTER_ADAPTER_BASE_PATH + "/query/key")
public Result<Set<String>> queryAdapterThreadPoolThreadPoolKey(ThreadPoolAdapterReqDTO requestParameter) {
Set<String> result = threadPoolAdapterService.queryThreadPoolKey(requestParameter);
return Results.success(result);
}
@PostMapping(REGISTER_ADAPTER_BASE_PATH + "/update")
public Result<Void> updateAdapterThreadPool(@RequestBody ThreadPoolAdapterReqDTO requestParameter) {
for (String each : requestParameter.getClientAddressList()) {

Loading…
Cancel
Save