Search in sources :

Example 16 with StorageContainer

use of org.apache.bookkeeper.stream.storage.api.sc.StorageContainer in project bookkeeper by apache.

the class StorageContainerRegistryImpl method unsafeStopStorageContainer.

private CompletableFuture<Void> unsafeStopStorageContainer(long scId) {
    if (closed) {
        return FutureUtils.exception(new ObjectClosedException(COMPONENT_NAME));
    }
    StorageContainer group = groups.remove(scId);
    if (null == group) {
        return FutureUtils.value(null);
    }
    log.info("Unregistered StorageContainer ('{}').", scId);
    return group.stop();
}
Also used : ObjectClosedException(org.apache.bookkeeper.common.exceptions.ObjectClosedException) StorageContainer(org.apache.bookkeeper.stream.storage.api.sc.StorageContainer)

Aggregations

StorageContainer (org.apache.bookkeeper.stream.storage.api.sc.StorageContainer)16 Test (org.junit.Test)12 ByteString (com.google.protobuf.ByteString)6 StorageContainerRequest (org.apache.bookkeeper.stream.proto.storage.StorageContainerRequest)4 StorageContainerResponse (org.apache.bookkeeper.stream.proto.storage.StorageContainerResponse)4 ObjectClosedException (org.apache.bookkeeper.common.exceptions.ObjectClosedException)3 OrderedScheduler (org.apache.bookkeeper.common.util.OrderedScheduler)2 StorageException (org.apache.bookkeeper.stream.storage.exceptions.StorageException)2 ListenableScheduledFuture (com.google.common.util.concurrent.ListenableScheduledFuture)1 ListeningScheduledExecutorService (com.google.common.util.concurrent.ListeningScheduledExecutorService)1 TimeUnit (java.util.concurrent.TimeUnit)1 FutureUtils (org.apache.bookkeeper.common.concurrent.FutureUtils)1 StreamProperties (org.apache.bookkeeper.stream.proto.StreamProperties)1 CreateNamespaceRequest (org.apache.bookkeeper.stream.proto.storage.CreateNamespaceRequest)1 CreateNamespaceResponse (org.apache.bookkeeper.stream.proto.storage.CreateNamespaceResponse)1 CreateStreamRequest (org.apache.bookkeeper.stream.proto.storage.CreateStreamRequest)1 CreateStreamResponse (org.apache.bookkeeper.stream.proto.storage.CreateStreamResponse)1 DeleteNamespaceRequest (org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceRequest)1 DeleteNamespaceResponse (org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceResponse)1 DeleteStreamRequest (org.apache.bookkeeper.stream.proto.storage.DeleteStreamRequest)1