[ server ] [ status ]- update some code - 1

This commit is contained in:
zeaslity
2023-02-03 11:30:20 +08:00
parent 0bd0c9da53
commit fd5f2607b9
12 changed files with 362 additions and 223 deletions

View File

@@ -8,8 +8,6 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import static io.wdd.rpc.scheduler.service.status.MonitorAllAgentStatus.ALL_AGENT_TOPIC_NAME_SET;
@SpringBootTest
class ServerApplicationTests {
@@ -57,8 +55,6 @@ class ServerApplicationTests {
completeScript.add(command4);
ALL_AGENT_TOPIC_NAME_SET.add("Chengdu-amd64-98-98066f");
ArrayList<String> targetMachineList = new ArrayList<>(
List.of(
"Chengdu-amd64-98-98066f"

View File

@@ -1,12 +1,48 @@
package io.wdd.server;
import io.wdd.common.beans.status.AgentHealthyStatusEnum;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public class SimpleTest {
public static void main(String[] args) {
HashMap<String, String> map = new HashMap<>();
HashMap<String, List<String>> hashMap = new HashMap<>();
hashMap.put(
"HEALTHY",
new ArrayList<>(
List.of(
"Tokyo-amd64-07-f66a41",
"Tokyo-amd64-03-dc543f"
)
)
);
hashMap
.get(AgentHealthyStatusEnum.FAILED.getStatus())
.stream()
.forEach(
agentTopicName -> {
map.put(
agentTopicName,
"0"
);
}
);
}
private void CompletableFutureTest() {
//任务1洗水壶->烧开水
CompletableFuture<String> f1 = CompletableFuture.supplyAsync(() -> {
try {