X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fclustering%2Fservices_implementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fclustering%2Fservices_implementation%2Finternal%2FClusterManager.java;h=83db4144007963a94e503a33345b1e641eadc2a0;hp=65e7720dd3141734951cb7d51e2b69bf8619df7b;hb=01c2c9975f3a0c33c1c211783c228c55b4aa3a46;hpb=99f9aa0ea003f3a8cc28dfef73b1b38a13e19039 diff --git a/opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManager.java b/opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManager.java index 65e7720dd3..83db414400 100644 --- a/opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManager.java +++ b/opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManager.java @@ -69,7 +69,7 @@ public class ClusterManager implements IClusterServices { private ViewChangedListener cacheManagerListener; private static String loopbackAddress = InetAddress.getLoopbackAddress().getHostAddress(); - + private static final int gossipRouterPortDefault = 12001; // defaultTransactionTimeout is 60 seconds private static int DEFAULT_TRANSACTION_TIMEOUT = 60; @@ -91,12 +91,11 @@ public class ClusterManager implements IClusterServices { */ private GossipRouter startGossiper() { boolean amIGossipRouter = false; - Integer gossipRouterPortDefault = 12001; Integer gossipRouterPort = gossipRouterPortDefault; InetAddress gossipRouterAddress = null; String supernodes_list = System.getProperty("supernodes", loopbackAddress); - StringBuffer sanitized_supernodes_list = new StringBuffer(); + StringBuilder sanitized_supernodes_list = new StringBuilder(); List myAddresses = new ArrayList(); StringTokenizer supernodes = new StringTokenizer(supernodes_list, ":"); @@ -135,7 +134,7 @@ public class ClusterManager implements IClusterServices { try { hostAddr = InetAddress.getByName(host); } catch (UnknownHostException ue) { - logger.error("Host not known"); + logger.error("Host {} is not known", host); continue; } if (host_port.hasMoreTokens()) { @@ -143,13 +142,12 @@ public class ClusterManager implements IClusterServices { try { port_num = Integer.valueOf(port); } catch (NumberFormatException ne) { - logger - .error("Supplied supernode gossiepr port is not recognized, using standard gossipport"); + logger.error("Supplied supernode gossip port is not recognized, using default gossip port {}", + gossipRouterPortDefault); port_num = gossipRouterPortDefault; } if ((port_num > 65535) || (port_num < 0)) { - logger - .error("Supplied supernode gossip port is outside a valid TCP port range"); + logger.error("Supplied supernode gossip port is outside a valid TCP port range"); port_num = gossipRouterPortDefault; } } @@ -168,8 +166,7 @@ public class ClusterManager implements IClusterServices { if (!sanitized_supernodes_list.toString().equals("")) { sanitized_supernodes_list.append(","); } - sanitized_supernodes_list.append(hostAddr.getHostAddress() + "[" - + port_num + "]"); + sanitized_supernodes_list.append(hostAddr.getHostAddress()).append("[").append(port_num).append("]"); } if (amIGossipRouter) {