Search in sources :

Example 1 with TServerInfo

use of org.apache.accumulo.server.manager.LiveTServerSet.TServerInfo in project accumulo by apache.

the class LiveTServerSetTest method testSessionIds.

@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]"));
}
Also used : TServerConnection(org.apache.accumulo.server.manager.LiveTServerSet.TServerConnection) Listener(org.apache.accumulo.server.manager.LiveTServerSet.Listener) ServerContext(org.apache.accumulo.server.ServerContext) HashMap(java.util.HashMap) TServerInfo(org.apache.accumulo.server.manager.LiveTServerSet.TServerInfo) TServerInstance(org.apache.accumulo.core.metadata.TServerInstance) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)1 TServerInstance (org.apache.accumulo.core.metadata.TServerInstance)1 ServerContext (org.apache.accumulo.server.ServerContext)1 Listener (org.apache.accumulo.server.manager.LiveTServerSet.Listener)1 TServerConnection (org.apache.accumulo.server.manager.LiveTServerSet.TServerConnection)1 TServerInfo (org.apache.accumulo.server.manager.LiveTServerSet.TServerInfo)1 Test (org.junit.Test)1