Sfoglia il codice sorgente

nacos持久化

master
wangjx 3 anni fa
parent
commit
b8ac3e899e
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. +8
    -0
      sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java

+ 8
- 0
sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java Vedi File

@@ -24,11 +24,13 @@ import java.util.concurrent.ConcurrentMap;

import com.alibaba.csp.sentinel.util.AssertUtil;

import lombok.extern.log4j.Log4j;
import org.springframework.stereotype.Component;

/**
* @author leyou
*/
@Log4j
@Component
public class SimpleMachineDiscovery implements MachineDiscovery {

@@ -44,6 +46,7 @@ public class SimpleMachineDiscovery implements MachineDiscovery {

@Override
public boolean removeMachine(String app, String ip, int port) {
log.debug("app is " + app);
AssertUtil.assertNotBlank(app, "app name cannot be blank");
AppInfo appInfo = apps.get(app);
if (appInfo != null) {
@@ -54,17 +57,22 @@ public class SimpleMachineDiscovery implements MachineDiscovery {

@Override
public List<String> getAppNames() {


log.debug("apps.keySet is " + apps.keySet());
return new ArrayList<>(apps.keySet());
}

@Override
public AppInfo getDetailApp(String app) {
log.debug("app is " + app);
AssertUtil.assertNotBlank(app, "app name cannot be blank");
return apps.get(app);
}

@Override
public Set<AppInfo> getBriefApps() {
log.debug("apps is " + apps.toString());
return new HashSet<>(apps.values());
}



Loading…
Annulla
Salva