This commit is contained in:
@@ -105,7 +105,7 @@ public abstract class ClusterAgent {
|
||||
}
|
||||
|
||||
//获取远程服务的可用ip列表
|
||||
protected abstract List<InetSocketAddress> queryAddress(NodeServer ns, String protocol, Service service);
|
||||
protected abstract Collection<InetSocketAddress> 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<InetSocketAddress> addrs = queryAddress(ns, protocol, service);
|
||||
Collection<InetSocketAddress> 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);
|
||||
}
|
||||
|
||||
@@ -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<String> 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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user