All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.skywalking.banyandb.measure.v1.MeasureServiceGrpc Maven / Gradle / Ivy

There is a newer version: 0.8.0-rc0
Show newest version
package org.apache.skywalking.banyandb.measure.v1;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.63.0)",
    comments = "Source: banyandb/v1/banyandb-measure.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class MeasureServiceGrpc {

  private MeasureServiceGrpc() {}

  public static final java.lang.String SERVICE_NAME = "banyandb.measure.v1.MeasureService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor getQueryMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Query",
      requestType = org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryRequest.class,
      responseType = org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getQueryMethod() {
    io.grpc.MethodDescriptor getQueryMethod;
    if ((getQueryMethod = MeasureServiceGrpc.getQueryMethod) == null) {
      synchronized (MeasureServiceGrpc.class) {
        if ((getQueryMethod = MeasureServiceGrpc.getQueryMethod) == null) {
          MeasureServiceGrpc.getQueryMethod = getQueryMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Query"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryResponse.getDefaultInstance()))
              .setSchemaDescriptor(new MeasureServiceMethodDescriptorSupplier("Query"))
              .build();
        }
      }
    }
    return getQueryMethod;
  }

  private static volatile io.grpc.MethodDescriptor getWriteMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Write",
      requestType = org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.WriteRequest.class,
      responseType = org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.WriteResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor getWriteMethod() {
    io.grpc.MethodDescriptor getWriteMethod;
    if ((getWriteMethod = MeasureServiceGrpc.getWriteMethod) == null) {
      synchronized (MeasureServiceGrpc.class) {
        if ((getWriteMethod = MeasureServiceGrpc.getWriteMethod) == null) {
          MeasureServiceGrpc.getWriteMethod = getWriteMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Write"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.WriteRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.WriteResponse.getDefaultInstance()))
              .setSchemaDescriptor(new MeasureServiceMethodDescriptorSupplier("Write"))
              .build();
        }
      }
    }
    return getWriteMethod;
  }

  private static volatile io.grpc.MethodDescriptor getTopNMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "TopN",
      requestType = org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNRequest.class,
      responseType = org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getTopNMethod() {
    io.grpc.MethodDescriptor getTopNMethod;
    if ((getTopNMethod = MeasureServiceGrpc.getTopNMethod) == null) {
      synchronized (MeasureServiceGrpc.class) {
        if ((getTopNMethod = MeasureServiceGrpc.getTopNMethod) == null) {
          MeasureServiceGrpc.getTopNMethod = getTopNMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TopN"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNResponse.getDefaultInstance()))
              .setSchemaDescriptor(new MeasureServiceMethodDescriptorSupplier("TopN"))
              .build();
        }
      }
    }
    return getTopNMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static MeasureServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public MeasureServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new MeasureServiceStub(channel, callOptions);
        }
      };
    return MeasureServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static MeasureServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public MeasureServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new MeasureServiceBlockingStub(channel, callOptions);
        }
      };
    return MeasureServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static MeasureServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public MeasureServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new MeasureServiceFutureStub(channel, callOptions);
        }
      };
    return MeasureServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public interface AsyncService {

    /**
     */
    default void query(org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getQueryMethod(), responseObserver);
    }

    /**
     */
    default io.grpc.stub.StreamObserver write(
        io.grpc.stub.StreamObserver responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getWriteMethod(), responseObserver);
    }

    /**
     */
    default void topN(org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTopNMethod(), responseObserver);
    }
  }

  /**
   * Base class for the server implementation of the service MeasureService.
   */
  public static abstract class MeasureServiceImplBase
      implements io.grpc.BindableService, AsyncService {

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return MeasureServiceGrpc.bindService(this);
    }
  }

  /**
   * A stub to allow clients to do asynchronous rpc calls to service MeasureService.
   */
  public static final class MeasureServiceStub
      extends io.grpc.stub.AbstractAsyncStub {
    private MeasureServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected MeasureServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new MeasureServiceStub(channel, callOptions);
    }

    /**
     */
    public void query(org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getQueryMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver write(
        io.grpc.stub.StreamObserver responseObserver) {
      return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
          getChannel().newCall(getWriteMethod(), getCallOptions()), responseObserver);
    }

    /**
     */
    public void topN(org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getTopNMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   * A stub to allow clients to do synchronous rpc calls to service MeasureService.
   */
  public static final class MeasureServiceBlockingStub
      extends io.grpc.stub.AbstractBlockingStub {
    private MeasureServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected MeasureServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new MeasureServiceBlockingStub(channel, callOptions);
    }

    /**
     */
    public org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryResponse query(org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getQueryMethod(), getCallOptions(), request);
    }

    /**
     */
    public org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNResponse topN(org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getTopNMethod(), getCallOptions(), request);
    }
  }

  /**
   * A stub to allow clients to do ListenableFuture-style rpc calls to service MeasureService.
   */
  public static final class MeasureServiceFutureStub
      extends io.grpc.stub.AbstractFutureStub {
    private MeasureServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected MeasureServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new MeasureServiceFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture query(
        org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getQueryMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture topN(
        org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getTopNMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_QUERY = 0;
  private static final int METHODID_TOP_N = 1;
  private static final int METHODID_WRITE = 2;

  private static final class MethodHandlers implements
      io.grpc.stub.ServerCalls.UnaryMethod,
      io.grpc.stub.ServerCalls.ServerStreamingMethod,
      io.grpc.stub.ServerCalls.ClientStreamingMethod,
      io.grpc.stub.ServerCalls.BidiStreamingMethod {
    private final AsyncService serviceImpl;
    private final int methodId;

    MethodHandlers(AsyncService serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
      switch (methodId) {
        case METHODID_QUERY:
          serviceImpl.query((org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_TOP_N:
          serviceImpl.topN((org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver invoke(
        io.grpc.stub.StreamObserver responseObserver) {
      switch (methodId) {
        case METHODID_WRITE:
          return (io.grpc.stub.StreamObserver) serviceImpl.write(
              (io.grpc.stub.StreamObserver) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getQueryMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryRequest,
              org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.QueryResponse>(
                service, METHODID_QUERY)))
        .addMethod(
          getWriteMethod(),
          io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
            new MethodHandlers<
              org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.WriteRequest,
              org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.WriteResponse>(
                service, METHODID_WRITE)))
        .addMethod(
          getTopNMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNRequest,
              org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.TopNResponse>(
                service, METHODID_TOP_N)))
        .build();
  }

  private static abstract class MeasureServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    MeasureServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return org.apache.skywalking.banyandb.measure.v1.BanyandbMeasure.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("MeasureService");
    }
  }

  private static final class MeasureServiceFileDescriptorSupplier
      extends MeasureServiceBaseDescriptorSupplier {
    MeasureServiceFileDescriptorSupplier() {}
  }

  private static final class MeasureServiceMethodDescriptorSupplier
      extends MeasureServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final java.lang.String methodName;

    MeasureServiceMethodDescriptorSupplier(java.lang.String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (MeasureServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new MeasureServiceFileDescriptorSupplier())
              .addMethod(getQueryMethod())
              .addMethod(getWriteMethod())
              .addMethod(getTopNMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy