diff --git a/src/org/redkale/boot/ClusterAgent.java b/src/org/redkale/boot/ClusterAgent.java index 100a12ae0..2497a0299 100644 --- a/src/org/redkale/boot/ClusterAgent.java +++ b/src/org/redkale/boot/ClusterAgent.java @@ -105,7 +105,7 @@ public abstract class ClusterAgent { } //获取远程服务的可用ip列表 - protected abstract List queryAddress(NodeServer ns, String protocol, Service service); + protected abstract Collection queryAddress(NodeServer ns, String protocol, Service service); //注册服务 protected abstract void register(NodeServer ns, String protocol, Service service); @@ -118,7 +118,7 @@ public abstract class ClusterAgent { Server server = ns.getServer(); String netprotocol = server instanceof SncpServer ? ((SncpServer) server).getNetprotocol() : Transport.DEFAULT_PROTOCOL; if (!Sncp.isSncpDyn(service)) return; - List addrs = queryAddress(ns, protocol, service); + Collection addrs = queryAddress(ns, protocol, service); if (addrs != null && !addrs.isEmpty()) { Sncp.updateTransport(service, transportFactory, Sncp.getResourceType(service).getName() + "-" + Sncp.getResourceName(service), netprotocol, ns.getSncpAddress(), null, addrs); } diff --git a/src/org/redkale/boot/NodeServer.java b/src/org/redkale/boot/NodeServer.java index 1f2602c5a..03db1eb0b 100644 --- a/src/org/redkale/boot/NodeServer.java +++ b/src/org/redkale/boot/NodeServer.java @@ -489,7 +489,9 @@ public abstract class NodeServer { localServices.clear(); localServices.addAll(swlist); //this.loadPersistData(); + long preinits = System.currentTimeMillis(); preInitServices(localServices, remoteServices); + long preinite = System.currentTimeMillis() - preinits; final List slist = sb == null ? null : new CopyOnWriteArrayList<>(); localServices.stream().forEach(y -> { long s = System.currentTimeMillis(); @@ -505,6 +507,7 @@ public abstract class NodeServer { } sb.append(threadName).append("All Services load cost ").append(System.currentTimeMillis() - starts).append(" ms" + LINE_SEPARATOR); } + if (sb != null && preinite > 10) sb.append(threadName).append("ALL cluster agents load ").append(preinite).append(" ms" + LINE_SEPARATOR); if (sb != null && sb.length() > 0) logger.log(Level.INFO, sb.toString()); }