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

io.etcd.jetcd.api.KVGrpc Maven / Gradle / Ivy

There is a newer version: 0.8.4
Show newest version
package io.etcd.jetcd.api;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.39.0)",
    comments = "Source: rpc.proto")
public final class KVGrpc {

  private KVGrpc() {}

  public static final String SERVICE_NAME = "etcdserverpb.KV";

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

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Range",
      requestType = io.etcd.jetcd.api.RangeRequest.class,
      responseType = io.etcd.jetcd.api.RangeResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getRangeMethod() {
    io.grpc.MethodDescriptor getRangeMethod;
    if ((getRangeMethod = KVGrpc.getRangeMethod) == null) {
      synchronized (KVGrpc.class) {
        if ((getRangeMethod = KVGrpc.getRangeMethod) == null) {
          KVGrpc.getRangeMethod = getRangeMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Range"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.RangeRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.RangeResponse.getDefaultInstance()))
              .setSchemaDescriptor(new KVMethodDescriptorSupplier("Range"))
              .build();
        }
      }
    }
    return getRangeMethod;
  }

  private static volatile io.grpc.MethodDescriptor getPutMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Put",
      requestType = io.etcd.jetcd.api.PutRequest.class,
      responseType = io.etcd.jetcd.api.PutResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getPutMethod() {
    io.grpc.MethodDescriptor getPutMethod;
    if ((getPutMethod = KVGrpc.getPutMethod) == null) {
      synchronized (KVGrpc.class) {
        if ((getPutMethod = KVGrpc.getPutMethod) == null) {
          KVGrpc.getPutMethod = getPutMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Put"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.PutRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.PutResponse.getDefaultInstance()))
              .setSchemaDescriptor(new KVMethodDescriptorSupplier("Put"))
              .build();
        }
      }
    }
    return getPutMethod;
  }

  private static volatile io.grpc.MethodDescriptor getDeleteRangeMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "DeleteRange",
      requestType = io.etcd.jetcd.api.DeleteRangeRequest.class,
      responseType = io.etcd.jetcd.api.DeleteRangeResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getDeleteRangeMethod() {
    io.grpc.MethodDescriptor getDeleteRangeMethod;
    if ((getDeleteRangeMethod = KVGrpc.getDeleteRangeMethod) == null) {
      synchronized (KVGrpc.class) {
        if ((getDeleteRangeMethod = KVGrpc.getDeleteRangeMethod) == null) {
          KVGrpc.getDeleteRangeMethod = getDeleteRangeMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteRange"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.DeleteRangeRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.DeleteRangeResponse.getDefaultInstance()))
              .setSchemaDescriptor(new KVMethodDescriptorSupplier("DeleteRange"))
              .build();
        }
      }
    }
    return getDeleteRangeMethod;
  }

  private static volatile io.grpc.MethodDescriptor getTxnMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Txn",
      requestType = io.etcd.jetcd.api.TxnRequest.class,
      responseType = io.etcd.jetcd.api.TxnResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getTxnMethod() {
    io.grpc.MethodDescriptor getTxnMethod;
    if ((getTxnMethod = KVGrpc.getTxnMethod) == null) {
      synchronized (KVGrpc.class) {
        if ((getTxnMethod = KVGrpc.getTxnMethod) == null) {
          KVGrpc.getTxnMethod = getTxnMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Txn"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.TxnRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.TxnResponse.getDefaultInstance()))
              .setSchemaDescriptor(new KVMethodDescriptorSupplier("Txn"))
              .build();
        }
      }
    }
    return getTxnMethod;
  }

  private static volatile io.grpc.MethodDescriptor getCompactMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Compact",
      requestType = io.etcd.jetcd.api.CompactionRequest.class,
      responseType = io.etcd.jetcd.api.CompactionResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getCompactMethod() {
    io.grpc.MethodDescriptor getCompactMethod;
    if ((getCompactMethod = KVGrpc.getCompactMethod) == null) {
      synchronized (KVGrpc.class) {
        if ((getCompactMethod = KVGrpc.getCompactMethod) == null) {
          KVGrpc.getCompactMethod = getCompactMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Compact"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.CompactionRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.etcd.jetcd.api.CompactionResponse.getDefaultInstance()))
              .setSchemaDescriptor(new KVMethodDescriptorSupplier("Compact"))
              .build();
        }
      }
    }
    return getCompactMethod;
  }

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

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

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

  /**
   */
  public static abstract class KVImplBase implements io.grpc.BindableService {

    /**
     * 
     * Range gets the keys in the range from the key-value store.
     * 
*/ public void range(io.etcd.jetcd.api.RangeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRangeMethod(), responseObserver); } /** *
     * Put puts the given key into the key-value store.
     * A put request increments the revision of the key-value store
     * and generates one event in the event history.
     * 
*/ public void put(io.etcd.jetcd.api.PutRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPutMethod(), responseObserver); } /** *
     * DeleteRange deletes the given range from the key-value store.
     * A delete request increments the revision of the key-value store
     * and generates a delete event in the event history for every deleted key.
     * 
*/ public void deleteRange(io.etcd.jetcd.api.DeleteRangeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteRangeMethod(), responseObserver); } /** *
     * Txn processes multiple requests in a single transaction.
     * A txn request increments the revision of the key-value store
     * and generates events with the same revision for every completed request.
     * It is not allowed to modify the same key several times within one txn.
     * 
*/ public void txn(io.etcd.jetcd.api.TxnRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTxnMethod(), responseObserver); } /** *
     * Compact compacts the event history in the etcd key-value store. The key-value
     * store should be periodically compacted or the event history will continue to grow
     * indefinitely.
     * 
*/ public void compact(io.etcd.jetcd.api.CompactionRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCompactMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getRangeMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< io.etcd.jetcd.api.RangeRequest, io.etcd.jetcd.api.RangeResponse>( this, METHODID_RANGE))) .addMethod( getPutMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< io.etcd.jetcd.api.PutRequest, io.etcd.jetcd.api.PutResponse>( this, METHODID_PUT))) .addMethod( getDeleteRangeMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< io.etcd.jetcd.api.DeleteRangeRequest, io.etcd.jetcd.api.DeleteRangeResponse>( this, METHODID_DELETE_RANGE))) .addMethod( getTxnMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< io.etcd.jetcd.api.TxnRequest, io.etcd.jetcd.api.TxnResponse>( this, METHODID_TXN))) .addMethod( getCompactMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< io.etcd.jetcd.api.CompactionRequest, io.etcd.jetcd.api.CompactionResponse>( this, METHODID_COMPACT))) .build(); } } /** */ public static final class KVStub extends io.grpc.stub.AbstractAsyncStub { private KVStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected KVStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new KVStub(channel, callOptions); } /** *
     * Range gets the keys in the range from the key-value store.
     * 
*/ public void range(io.etcd.jetcd.api.RangeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getRangeMethod(), getCallOptions()), request, responseObserver); } /** *
     * Put puts the given key into the key-value store.
     * A put request increments the revision of the key-value store
     * and generates one event in the event history.
     * 
*/ public void put(io.etcd.jetcd.api.PutRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getPutMethod(), getCallOptions()), request, responseObserver); } /** *
     * DeleteRange deletes the given range from the key-value store.
     * A delete request increments the revision of the key-value store
     * and generates a delete event in the event history for every deleted key.
     * 
*/ public void deleteRange(io.etcd.jetcd.api.DeleteRangeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getDeleteRangeMethod(), getCallOptions()), request, responseObserver); } /** *
     * Txn processes multiple requests in a single transaction.
     * A txn request increments the revision of the key-value store
     * and generates events with the same revision for every completed request.
     * It is not allowed to modify the same key several times within one txn.
     * 
*/ public void txn(io.etcd.jetcd.api.TxnRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getTxnMethod(), getCallOptions()), request, responseObserver); } /** *
     * Compact compacts the event history in the etcd key-value store. The key-value
     * store should be periodically compacted or the event history will continue to grow
     * indefinitely.
     * 
*/ public void compact(io.etcd.jetcd.api.CompactionRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getCompactMethod(), getCallOptions()), request, responseObserver); } } /** */ public static final class KVBlockingStub extends io.grpc.stub.AbstractBlockingStub { private KVBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected KVBlockingStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new KVBlockingStub(channel, callOptions); } /** *
     * Range gets the keys in the range from the key-value store.
     * 
*/ public io.etcd.jetcd.api.RangeResponse range(io.etcd.jetcd.api.RangeRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getRangeMethod(), getCallOptions(), request); } /** *
     * Put puts the given key into the key-value store.
     * A put request increments the revision of the key-value store
     * and generates one event in the event history.
     * 
*/ public io.etcd.jetcd.api.PutResponse put(io.etcd.jetcd.api.PutRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getPutMethod(), getCallOptions(), request); } /** *
     * DeleteRange deletes the given range from the key-value store.
     * A delete request increments the revision of the key-value store
     * and generates a delete event in the event history for every deleted key.
     * 
*/ public io.etcd.jetcd.api.DeleteRangeResponse deleteRange(io.etcd.jetcd.api.DeleteRangeRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeleteRangeMethod(), getCallOptions(), request); } /** *
     * Txn processes multiple requests in a single transaction.
     * A txn request increments the revision of the key-value store
     * and generates events with the same revision for every completed request.
     * It is not allowed to modify the same key several times within one txn.
     * 
*/ public io.etcd.jetcd.api.TxnResponse txn(io.etcd.jetcd.api.TxnRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getTxnMethod(), getCallOptions(), request); } /** *
     * Compact compacts the event history in the etcd key-value store. The key-value
     * store should be periodically compacted or the event history will continue to grow
     * indefinitely.
     * 
*/ public io.etcd.jetcd.api.CompactionResponse compact(io.etcd.jetcd.api.CompactionRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getCompactMethod(), getCallOptions(), request); } } /** */ public static final class KVFutureStub extends io.grpc.stub.AbstractFutureStub { private KVFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected KVFutureStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new KVFutureStub(channel, callOptions); } /** *
     * Range gets the keys in the range from the key-value store.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture range( io.etcd.jetcd.api.RangeRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getRangeMethod(), getCallOptions()), request); } /** *
     * Put puts the given key into the key-value store.
     * A put request increments the revision of the key-value store
     * and generates one event in the event history.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture put( io.etcd.jetcd.api.PutRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getPutMethod(), getCallOptions()), request); } /** *
     * DeleteRange deletes the given range from the key-value store.
     * A delete request increments the revision of the key-value store
     * and generates a delete event in the event history for every deleted key.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture deleteRange( io.etcd.jetcd.api.DeleteRangeRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteRangeMethod(), getCallOptions()), request); } /** *
     * Txn processes multiple requests in a single transaction.
     * A txn request increments the revision of the key-value store
     * and generates events with the same revision for every completed request.
     * It is not allowed to modify the same key several times within one txn.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture txn( io.etcd.jetcd.api.TxnRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getTxnMethod(), getCallOptions()), request); } /** *
     * Compact compacts the event history in the etcd key-value store. The key-value
     * store should be periodically compacted or the event history will continue to grow
     * indefinitely.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture compact( io.etcd.jetcd.api.CompactionRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCompactMethod(), getCallOptions()), request); } } private static final int METHODID_RANGE = 0; private static final int METHODID_PUT = 1; private static final int METHODID_DELETE_RANGE = 2; private static final int METHODID_TXN = 3; private static final int METHODID_COMPACT = 4; 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 KVImplBase serviceImpl; private final int methodId; MethodHandlers(KVImplBase 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_RANGE: serviceImpl.range((io.etcd.jetcd.api.RangeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_PUT: serviceImpl.put((io.etcd.jetcd.api.PutRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_DELETE_RANGE: serviceImpl.deleteRange((io.etcd.jetcd.api.DeleteRangeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_TXN: serviceImpl.txn((io.etcd.jetcd.api.TxnRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_COMPACT: serviceImpl.compact((io.etcd.jetcd.api.CompactionRequest) 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) { default: throw new AssertionError(); } } } private static abstract class KVBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { KVBaseDescriptorSupplier() {} @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return io.etcd.jetcd.api.JetcdProto.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("KV"); } } private static final class KVFileDescriptorSupplier extends KVBaseDescriptorSupplier { KVFileDescriptorSupplier() {} } private static final class KVMethodDescriptorSupplier extends KVBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final String methodName; KVMethodDescriptorSupplier(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 (KVGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new KVFileDescriptorSupplier()) .addMethod(getRangeMethod()) .addMethod(getPutMethod()) .addMethod(getDeleteRangeMethod()) .addMethod(getTxnMethod()) .addMethod(getCompactMethod()) .build(); } } } return result; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy