diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-04-22 00:33:12 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-04-22 11:31:01 +0200 |
commit | 9e7180cb7a2ef747bb72560097fedbdb8f5f08f1 (patch) | |
tree | 08d0af8ee2f777b6a7baa235bff4ef54d3a87945 /clustercontroller-core | |
parent | 6a61110fef80bebfdd7fe7725005a6560974b22d (diff) |
Change interface from Mirror.Entry[] to List<Mirror.Entry> as you already have a list.
Avoid having to do an array copy that is not necessary.
Diffstat (limited to 'clustercontroller-core')
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/rpc/SlobrokClient.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/rpc/SlobrokClient.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/rpc/SlobrokClient.java index 498037a4984..bb3d7e049d1 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/rpc/SlobrokClient.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/rpc/SlobrokClient.java @@ -15,7 +15,12 @@ import com.yahoo.vespa.clustercontroller.core.Timer; import com.yahoo.vespa.clustercontroller.core.ContentCluster; import com.yahoo.vespa.clustercontroller.core.listeners.NodeAddedOrRemovedListener; -import java.util.*; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.TreeMap; import java.util.logging.Logger; public class SlobrokClient implements NodeLookup { @@ -190,8 +195,8 @@ public class SlobrokClient implements NodeLookup { private Map<Node, SlobrokData> getSlobrokData(String pattern) { Map<Node, SlobrokData> result = new TreeMap<>(); - Mirror.Entry[] entries = mirror.lookup(pattern); - log.log(LogLevel.SPAM, "Looking for slobrok entries with pattern '" + pattern + "'. Found " + entries.length + " entries."); + List<Mirror.Entry> entries = mirror.lookup(pattern); + log.log(LogLevel.SPAM, "Looking for slobrok entries with pattern '" + pattern + "'. Found " + entries.size() + " entries."); for (Mirror.Entry entry : entries) { StringTokenizer st = new StringTokenizer(entry.getName(), "/"); String addressType = st.nextToken(); @@ -209,7 +214,7 @@ public class SlobrokClient implements NodeLookup { private static class SlobrokData { public Node node; - public String rpcAddress; + String rpcAddress; SlobrokData(Node node, String rpcAddress) { this.node = node; |