@Test public void testSessionIds() { Map<String,TServerInfo> servers = new HashMap<>(); TServerConnection mockConn = EasyMock.createMock(TServerConnection.class); TServerInfo server1 = new TServerInfo( new TServerInstance(HostAndPort.fromParts("localhost", 1234), "5555"), mockConn); servers.put("server1", server1); LiveTServerSet tservers = new LiveTServerSet(EasyMock.createMock(ServerContext.class), EasyMock.createMock(Listener.class)); assertEquals(server1.instance, tservers.find(servers, "localhost:1234")); assertNull(tservers.find(servers, "localhost:4321")); assertEquals(server1.instance, tservers.find(servers, "localhost:1234[5555]")); assertNull(tservers.find(servers, "localhost:1234[55755]")); }
public synchronized TServerInstance find(String tabletServer) { return find(current, tabletServer); }
LiveTServerSet implements Watcher { public synchronized TServerInstance find(String tabletServer) { return find(current, tabletServer); } }
LiveTServerSet implements Watcher { public synchronized TServerInstance find(String tabletServer) { return find(current, tabletServer); } LiveTServerSet(ServerContext context, Listener cback); }
LiveTServerSet implements Watcher { public synchronized TServerInstance find(String tabletServer) { return find(current, tabletServer); } LiveTServerSet(ServerContext context, Listener cback); synchronized ZooCache getZooCache(); synchronized void startListeningForTabletServerChanges(); synchronized void scanServers(); @Override void process(WatchedEvent event); synchronized TServerConnection getConnection(TServerInstance server); synchronized Set<TServerInstance> getCurrentServers(); synchronized int size(); synchronized TServerInstance find(String tabletServer); synchronized void remove(TServerInstance server); }
LiveTServerSet implements Watcher { public synchronized TServerInstance find(String tabletServer) { return find(current, tabletServer); } LiveTServerSet(ServerContext context, Listener cback); synchronized ZooCache getZooCache(); synchronized void startListeningForTabletServerChanges(); synchronized void scanServers(); @Override void process(WatchedEvent event); synchronized TServerConnection getConnection(TServerInstance server); synchronized Set<TServerInstance> getCurrentServers(); synchronized int size(); synchronized TServerInstance find(String tabletServer); synchronized void remove(TServerInstance server);  }