@Test public void testNullNodeSelectorSpec() { List<InetSocketAddress> result = manager.getServers(null); Assert.assertEquals(numOfServers, result.size()); }
public List<InetSocketAddress> getServers(NodeSelectorSpec spec) { List<InetSocketAddress> nodes = new ArrayList<InetSocketAddress>(); for (Map.Entry<InetSocketAddress, KernelServerInfo> entry : servers.entrySet()) { if (entry.getValue().config.matchNodeSelectorSpec(spec)) { nodes.add(entry.getKey()); } } return nodes; }
KernelServerManager { public List<InetSocketAddress> getServers(NodeSelectorSpec spec) { List<InetSocketAddress> nodes = new ArrayList<InetSocketAddress>(); for (Map.Entry<InetSocketAddress, KernelServerInfo> entry : servers.entrySet()) { if (entry.getValue().config.matchNodeSelectorSpec(spec)) { nodes.add(entry.getKey()); } } return nodes; } }
KernelServerManager { public List<InetSocketAddress> getServers(NodeSelectorSpec spec) { List<InetSocketAddress> nodes = new ArrayList<InetSocketAddress>(); for (Map.Entry<InetSocketAddress, KernelServerInfo> entry : servers.entrySet()) { if (entry.getValue().config.matchNodeSelectorSpec(spec)) { nodes.add(entry.getKey()); } } return nodes; } KernelServerManager(); }
KernelServerManager { public List<InetSocketAddress> getServers(NodeSelectorSpec spec) { List<InetSocketAddress> nodes = new ArrayList<InetSocketAddress>(); for (Map.Entry<InetSocketAddress, KernelServerInfo> entry : servers.entrySet()) { if (entry.getValue().config.matchNodeSelectorSpec(spec)) { nodes.add(entry.getKey()); } } return nodes; } KernelServerManager(); void removeKernelServer(ServerInfo srvInfo); void registerKernelServer(ServerInfo info); void receiveHeartBeat(ServerInfo srvinfo); List<InetSocketAddress> getServers(NodeSelectorSpec spec); ArrayList<String> getRegions(); KernelServer getServer(InetSocketAddress address); InetSocketAddress getBestSuitableServer(MicroServiceSpec spec); int getKernelServerProcessorCount(InetSocketAddress host); Map<InetSocketAddress, NodeMetric> getKernelServerMetric(InetSocketAddress host); }
KernelServerManager { public List<InetSocketAddress> getServers(NodeSelectorSpec spec) { List<InetSocketAddress> nodes = new ArrayList<InetSocketAddress>(); for (Map.Entry<InetSocketAddress, KernelServerInfo> entry : servers.entrySet()) { if (entry.getValue().config.matchNodeSelectorSpec(spec)) { nodes.add(entry.getKey()); } } return nodes; } KernelServerManager(); void removeKernelServer(ServerInfo srvInfo); void registerKernelServer(ServerInfo info); void receiveHeartBeat(ServerInfo srvinfo); List<InetSocketAddress> getServers(NodeSelectorSpec spec); ArrayList<String> getRegions(); KernelServer getServer(InetSocketAddress address); InetSocketAddress getBestSuitableServer(MicroServiceSpec spec); int getKernelServerProcessorCount(InetSocketAddress host); Map<InetSocketAddress, NodeMetric> getKernelServerMetric(InetSocketAddress host);  }