Search in sources :

Example 1 with Revisioned

use of org.apache.bookkeeper.common.util.Revisioned in project bookkeeper by apache.

the class TestProtocolInternalUtils method testCreateGetStorageContainerEndpointRequest.

// 
// Test Location Server Requests
// 
@Test
public void testCreateGetStorageContainerEndpointRequest() {
    List<Revisioned<Long>> scs = Lists.newArrayList(Revisioned.of(1000L, 1L), Revisioned.of(2000L, 2L), Revisioned.of(3000L, 3L));
    GetStorageContainerEndpointRequest request = createGetStorageContainerEndpointRequest(scs);
    assertEquals(3, request.getRequestsCount());
    int i = 1;
    for (OneStorageContainerEndpointRequest oneRequest : request.getRequestsList()) {
        assertEquals(1000L * i, oneRequest.getStorageContainer());
        assertEquals(1L * i, oneRequest.getRevision());
        ++i;
    }
}
Also used : Revisioned(org.apache.bookkeeper.common.util.Revisioned) GetStorageContainerEndpointRequest(org.apache.bookkeeper.stream.proto.storage.GetStorageContainerEndpointRequest) ProtoUtils.createGetStorageContainerEndpointRequest(org.apache.bookkeeper.stream.protocol.util.ProtoUtils.createGetStorageContainerEndpointRequest) OneStorageContainerEndpointRequest(org.apache.bookkeeper.stream.proto.storage.OneStorageContainerEndpointRequest) StorageContainerEndpoint(org.apache.bookkeeper.stream.proto.storage.StorageContainerEndpoint) Test(org.junit.Test)

Aggregations

Revisioned (org.apache.bookkeeper.common.util.Revisioned)1 GetStorageContainerEndpointRequest (org.apache.bookkeeper.stream.proto.storage.GetStorageContainerEndpointRequest)1 OneStorageContainerEndpointRequest (org.apache.bookkeeper.stream.proto.storage.OneStorageContainerEndpointRequest)1 StorageContainerEndpoint (org.apache.bookkeeper.stream.proto.storage.StorageContainerEndpoint)1 ProtoUtils.createGetStorageContainerEndpointRequest (org.apache.bookkeeper.stream.protocol.util.ProtoUtils.createGetStorageContainerEndpointRequest)1 Test (org.junit.Test)1