Search in sources :

Example 6 with DeleteNamespaceResponse

use of org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceResponse in project bookkeeper by apache.

the class TestRootRangeStoreImpl method deleteNamespaceAndVerify.

private DeleteNamespaceResponse deleteNamespaceAndVerify(String nsName) throws Exception {
    CompletableFuture<DeleteNamespaceResponse> deleteFuture = rootRangeStore.deleteNamespace(createDeleteNamespaceRequest(nsName));
    DeleteNamespaceResponse deleteResp = FutureUtils.result(deleteFuture);
    assertEquals(StatusCode.SUCCESS, deleteResp.getCode());
    return deleteResp;
}
Also used : DeleteNamespaceResponse(org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceResponse)

Example 7 with DeleteNamespaceResponse

use of org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceResponse in project bookkeeper by apache.

the class StorageContainerImplTest method testDeleteNamespace.

@Test
public void testDeleteNamespace() throws Exception {
    mockStorageContainer(SCID);
    DeleteNamespaceResponse expectedResp = DeleteNamespaceResponse.getDefaultInstance();
    when(rrStore.deleteNamespace(any(DeleteNamespaceRequest.class))).thenReturn(FutureUtils.value(expectedResp));
    DeleteNamespaceRequest expectedReq = DeleteNamespaceRequest.getDefaultInstance();
    assertSame(expectedResp, FutureUtils.result(rrStore.deleteNamespace(expectedReq)));
    verify(rrStore, times(1)).deleteNamespace(same(expectedReq));
}
Also used : DeleteNamespaceRequest(org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceRequest) DeleteNamespaceResponse(org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceResponse) Test(org.junit.Test)

Aggregations

DeleteNamespaceResponse (org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceResponse)7 Test (org.junit.Test)6 DeleteNamespaceRequest (org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceRequest)4 ProtoUtils.createDeleteNamespaceRequest (org.apache.bookkeeper.stream.protocol.util.ProtoUtils.createDeleteNamespaceRequest)3 StreamObserver (io.grpc.stub.StreamObserver)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 RangeStoreImpl (org.apache.bookkeeper.stream.storage.impl.RangeStoreImpl)2 ByteString (com.google.protobuf.ByteString)1 StorageContainer (org.apache.bookkeeper.stream.storage.api.sc.StorageContainer)1