Search in sources :

Example 1 with LocationClient

use of org.apache.bookkeeper.clients.impl.internal.api.LocationClient in project bookkeeper by apache.

the class TestStorageServerClientManagerImpl method testGetLocationClient.

@SuppressWarnings("unchecked")
@Test
public void testGetLocationClient() throws Exception {
    LocationClient lc = serverManager.getLocationClient();
    assertNotNull(lc);
    assertEquals(lc, serverManager.getLocationClient());
    List<OneStorageContainerEndpointResponse> responses = FutureUtils.result(lc.locateStorageContainers(Lists.newArrayList(Revisioned.of(123L, 456L))));
    assertEquals(1, responses.size());
    assertEquals(StatusCode.SUCCESS, responses.get(0).getStatusCode());
    assertEquals(ENDPOINT, responses.get(0).getEndpoint().getRwEndpoint());
    assertEquals(0, responses.get(0).getEndpoint().getRoEndpointCount());
}
Also used : LocationClient(org.apache.bookkeeper.clients.impl.internal.api.LocationClient) OneStorageContainerEndpointResponse(org.apache.bookkeeper.stream.proto.storage.OneStorageContainerEndpointResponse) Test(org.junit.Test)

Aggregations

LocationClient (org.apache.bookkeeper.clients.impl.internal.api.LocationClient)1 OneStorageContainerEndpointResponse (org.apache.bookkeeper.stream.proto.storage.OneStorageContainerEndpointResponse)1 Test (org.junit.Test)1