Search in sources :

Example 1 with DropSchemaResponse

use of com.alibaba.maxgraph.proto.groot.DropSchemaResponse in project GraphScope by alibaba.

the class MaxTestGraph method dropData.

private void dropData() {
    CompletableFuture<GraphSchema> future = new CompletableFuture<>();
    this.clientService.dropSchema(DropSchemaRequest.newBuilder().build(), new StreamObserver<DropSchemaResponse>() {

        @Override
        public void onNext(DropSchemaResponse value) {
            future.complete(GraphDef.parseProto(value.getGraphDef()));
        }

        @Override
        public void onError(Throwable t) {
            future.completeExceptionally(t);
        }

        @Override
        public void onCompleted() {
        }
    });
    GraphSchema schema;
    try {
        schema = future.get();
    } catch (Exception e) {
        throw new MaxGraphException(e);
    }
    logger.info("drop schema: " + ((GraphDef) schema).toProto().toString());
}
Also used : DropSchemaResponse(com.alibaba.maxgraph.proto.groot.DropSchemaResponse) CompletableFuture(java.util.concurrent.CompletableFuture) MaxGraphException(com.alibaba.maxgraph.compiler.api.exception.MaxGraphException) GraphSchema(com.alibaba.maxgraph.compiler.api.schema.GraphSchema) URISyntaxException(java.net.URISyntaxException) MaxGraphException(com.alibaba.maxgraph.compiler.api.exception.MaxGraphException) IOException(java.io.IOException)

Aggregations

MaxGraphException (com.alibaba.maxgraph.compiler.api.exception.MaxGraphException)1 GraphSchema (com.alibaba.maxgraph.compiler.api.schema.GraphSchema)1 DropSchemaResponse (com.alibaba.maxgraph.proto.groot.DropSchemaResponse)1 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 CompletableFuture (java.util.concurrent.CompletableFuture)1