use of org.apache.bookkeeper.stream.proto.storage.StatusCode in project bookkeeper by apache.
the class RootRangeClientImpl method processDeleteStreamResponse.
private void processDeleteStreamResponse(String streamName, DeleteStreamResponse response, CompletableFuture<Boolean> deleteStreamFuture) {
StatusCode code = response.getCode();
if (StatusCode.SUCCESS == code) {
deleteStreamFuture.complete(true);
return;
}
deleteStreamFuture.completeExceptionally(createRootRangeException(streamName, code));
}
use of org.apache.bookkeeper.stream.proto.storage.StatusCode in project bookkeeper by apache.
the class RootRangeStoreImpl method deleteStream.
@Override
public CompletableFuture<DeleteStreamResponse> deleteStream(DeleteStreamRequest request) {
String streamName = request.getName();
String nsName = request.getColName();
StatusCode code = verifyStreamRequest(nsName, streamName);
if (StatusCode.SUCCESS != code) {
return FutureUtils.value(DeleteStreamResponse.newBuilder().setCode(code).build());
}
return deleteStream(nsName, streamName);
}
use of org.apache.bookkeeper.stream.proto.storage.StatusCode in project bookkeeper by apache.
the class RootRangeStoreImpl method verifyCreateNamespaceRequest.
StatusCode verifyCreateNamespaceRequest(CreateNamespaceRequest request) {
String colName = request.getName();
StatusCode code = StatusCode.SUCCESS;
if (!validateNamespaceName(colName)) {
log.error("Failed to create namespace due to invalid namespace name {}", colName);
code = StatusCode.INVALID_NAMESPACE_NAME;
}
return code;
}
Aggregations