com.ibm.etcd.api.KVGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of etcd-java Show documentation
Show all versions of etcd-java Show documentation
etcd3 java client and utilities
package com.ibm.etcd.api;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.30.1)",
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 = com.ibm.etcd.api.RangeRequest.class,
responseType = com.ibm.etcd.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(
com.ibm.etcd.api.RangeRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.ibm.etcd.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 = com.ibm.etcd.api.PutRequest.class,
responseType = com.ibm.etcd.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(
com.ibm.etcd.api.PutRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.ibm.etcd.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 = com.ibm.etcd.api.DeleteRangeRequest.class,
responseType = com.ibm.etcd.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(
com.ibm.etcd.api.DeleteRangeRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.ibm.etcd.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 = com.ibm.etcd.api.TxnRequest.class,
responseType = com.ibm.etcd.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(
com.ibm.etcd.api.TxnRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.ibm.etcd.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 = com.ibm.etcd.api.CompactionRequest.class,
responseType = com.ibm.etcd.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(
com.ibm.etcd.api.CompactionRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.ibm.etcd.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(com.ibm.etcd.api.RangeRequest request,
io.grpc.stub.StreamObserver responseObserver) {
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(com.ibm.etcd.api.PutRequest request,
io.grpc.stub.StreamObserver responseObserver) {
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(com.ibm.etcd.api.DeleteRangeRequest request,
io.grpc.stub.StreamObserver responseObserver) {
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(com.ibm.etcd.api.TxnRequest request,
io.grpc.stub.StreamObserver responseObserver) {
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(com.ibm.etcd.api.CompactionRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getCompactMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getRangeMethod(),
asyncUnaryCall(
new MethodHandlers<
com.ibm.etcd.api.RangeRequest,
com.ibm.etcd.api.RangeResponse>(
this, METHODID_RANGE)))
.addMethod(
getPutMethod(),
asyncUnaryCall(
new MethodHandlers<
com.ibm.etcd.api.PutRequest,
com.ibm.etcd.api.PutResponse>(
this, METHODID_PUT)))
.addMethod(
getDeleteRangeMethod(),
asyncUnaryCall(
new MethodHandlers<
com.ibm.etcd.api.DeleteRangeRequest,
com.ibm.etcd.api.DeleteRangeResponse>(
this, METHODID_DELETE_RANGE)))
.addMethod(
getTxnMethod(),
asyncUnaryCall(
new MethodHandlers<
com.ibm.etcd.api.TxnRequest,
com.ibm.etcd.api.TxnResponse>(
this, METHODID_TXN)))
.addMethod(
getCompactMethod(),
asyncUnaryCall(
new MethodHandlers<
com.ibm.etcd.api.CompactionRequest,
com.ibm.etcd.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(com.ibm.etcd.api.RangeRequest request,
io.grpc.stub.StreamObserver responseObserver) {
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(com.ibm.etcd.api.PutRequest request,
io.grpc.stub.StreamObserver responseObserver) {
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(com.ibm.etcd.api.DeleteRangeRequest request,
io.grpc.stub.StreamObserver responseObserver) {
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(com.ibm.etcd.api.TxnRequest request,
io.grpc.stub.StreamObserver responseObserver) {
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(com.ibm.etcd.api.CompactionRequest request,
io.grpc.stub.StreamObserver responseObserver) {
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 com.ibm.etcd.api.RangeResponse range(com.ibm.etcd.api.RangeRequest request) {
return 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 com.ibm.etcd.api.PutResponse put(com.ibm.etcd.api.PutRequest request) {
return 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 com.ibm.etcd.api.DeleteRangeResponse deleteRange(com.ibm.etcd.api.DeleteRangeRequest request) {
return 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 com.ibm.etcd.api.TxnResponse txn(com.ibm.etcd.api.TxnRequest request) {
return 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 com.ibm.etcd.api.CompactionResponse compact(com.ibm.etcd.api.CompactionRequest request) {
return 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(
com.ibm.etcd.api.RangeRequest request) {
return 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(
com.ibm.etcd.api.PutRequest request) {
return 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(
com.ibm.etcd.api.DeleteRangeRequest request) {
return 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(
com.ibm.etcd.api.TxnRequest request) {
return 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(
com.ibm.etcd.api.CompactionRequest request) {
return 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((com.ibm.etcd.api.RangeRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_PUT:
serviceImpl.put((com.ibm.etcd.api.PutRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_DELETE_RANGE:
serviceImpl.deleteRange((com.ibm.etcd.api.DeleteRangeRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_TXN:
serviceImpl.txn((com.ibm.etcd.api.TxnRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_COMPACT:
serviceImpl.compact((com.ibm.etcd.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 com.ibm.etcd.api.Rpc.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;
}
}