
io.numaproj.numaflow.source.v1.SourceGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of numaflow-java Show documentation
Show all versions of numaflow-java Show documentation
SDK to implement Numaflow Source or User Defined Functions or Sinks in Java.
The newest version!
package io.numaproj.numaflow.source.v1;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.65.0)",
comments = "Source: source/v1/source.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class SourceGrpc {
private SourceGrpc() {}
public static final java.lang.String SERVICE_NAME = "source.v1.Source";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getReadFnMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ReadFn",
requestType = io.numaproj.numaflow.source.v1.SourceOuterClass.ReadRequest.class,
responseType = io.numaproj.numaflow.source.v1.SourceOuterClass.ReadResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
public static io.grpc.MethodDescriptor getReadFnMethod() {
io.grpc.MethodDescriptor getReadFnMethod;
if ((getReadFnMethod = SourceGrpc.getReadFnMethod) == null) {
synchronized (SourceGrpc.class) {
if ((getReadFnMethod = SourceGrpc.getReadFnMethod) == null) {
SourceGrpc.getReadFnMethod = getReadFnMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReadFn"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.numaproj.numaflow.source.v1.SourceOuterClass.ReadRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.numaproj.numaflow.source.v1.SourceOuterClass.ReadResponse.getDefaultInstance()))
.setSchemaDescriptor(new SourceMethodDescriptorSupplier("ReadFn"))
.build();
}
}
}
return getReadFnMethod;
}
private static volatile io.grpc.MethodDescriptor getAckFnMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "AckFn",
requestType = io.numaproj.numaflow.source.v1.SourceOuterClass.AckRequest.class,
responseType = io.numaproj.numaflow.source.v1.SourceOuterClass.AckResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
public static io.grpc.MethodDescriptor getAckFnMethod() {
io.grpc.MethodDescriptor getAckFnMethod;
if ((getAckFnMethod = SourceGrpc.getAckFnMethod) == null) {
synchronized (SourceGrpc.class) {
if ((getAckFnMethod = SourceGrpc.getAckFnMethod) == null) {
SourceGrpc.getAckFnMethod = getAckFnMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "AckFn"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.numaproj.numaflow.source.v1.SourceOuterClass.AckRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.numaproj.numaflow.source.v1.SourceOuterClass.AckResponse.getDefaultInstance()))
.setSchemaDescriptor(new SourceMethodDescriptorSupplier("AckFn"))
.build();
}
}
}
return getAckFnMethod;
}
private static volatile io.grpc.MethodDescriptor getPendingFnMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "PendingFn",
requestType = com.google.protobuf.Empty.class,
responseType = io.numaproj.numaflow.source.v1.SourceOuterClass.PendingResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getPendingFnMethod() {
io.grpc.MethodDescriptor getPendingFnMethod;
if ((getPendingFnMethod = SourceGrpc.getPendingFnMethod) == null) {
synchronized (SourceGrpc.class) {
if ((getPendingFnMethod = SourceGrpc.getPendingFnMethod) == null) {
SourceGrpc.getPendingFnMethod = getPendingFnMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "PendingFn"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.Empty.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.numaproj.numaflow.source.v1.SourceOuterClass.PendingResponse.getDefaultInstance()))
.setSchemaDescriptor(new SourceMethodDescriptorSupplier("PendingFn"))
.build();
}
}
}
return getPendingFnMethod;
}
private static volatile io.grpc.MethodDescriptor getPartitionsFnMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "PartitionsFn",
requestType = com.google.protobuf.Empty.class,
responseType = io.numaproj.numaflow.source.v1.SourceOuterClass.PartitionsResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getPartitionsFnMethod() {
io.grpc.MethodDescriptor getPartitionsFnMethod;
if ((getPartitionsFnMethod = SourceGrpc.getPartitionsFnMethod) == null) {
synchronized (SourceGrpc.class) {
if ((getPartitionsFnMethod = SourceGrpc.getPartitionsFnMethod) == null) {
SourceGrpc.getPartitionsFnMethod = getPartitionsFnMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "PartitionsFn"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.Empty.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.numaproj.numaflow.source.v1.SourceOuterClass.PartitionsResponse.getDefaultInstance()))
.setSchemaDescriptor(new SourceMethodDescriptorSupplier("PartitionsFn"))
.build();
}
}
}
return getPartitionsFnMethod;
}
private static volatile io.grpc.MethodDescriptor getIsReadyMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "IsReady",
requestType = com.google.protobuf.Empty.class,
responseType = io.numaproj.numaflow.source.v1.SourceOuterClass.ReadyResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getIsReadyMethod() {
io.grpc.MethodDescriptor getIsReadyMethod;
if ((getIsReadyMethod = SourceGrpc.getIsReadyMethod) == null) {
synchronized (SourceGrpc.class) {
if ((getIsReadyMethod = SourceGrpc.getIsReadyMethod) == null) {
SourceGrpc.getIsReadyMethod = getIsReadyMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "IsReady"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.Empty.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.numaproj.numaflow.source.v1.SourceOuterClass.ReadyResponse.getDefaultInstance()))
.setSchemaDescriptor(new SourceMethodDescriptorSupplier("IsReady"))
.build();
}
}
}
return getIsReadyMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static SourceStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public SourceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new SourceStub(channel, callOptions);
}
};
return SourceStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static SourceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public SourceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new SourceBlockingStub(channel, callOptions);
}
};
return SourceBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static SourceFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public SourceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new SourceFutureStub(channel, callOptions);
}
};
return SourceFutureStub.newStub(factory, channel);
}
/**
*/
public interface AsyncService {
/**
*
* Read returns a stream of datum responses.
* The size of the returned responses is less than or equal to the num_records specified in each ReadRequest.
* If the request timeout is reached on the server side, the returned responses will contain all the datum that have been read (which could be an empty list).
* The server will continue to read and respond to subsequent ReadRequests until the client closes the stream.
* Once it has sent all the datum, the server will send a ReadResponse with the end of transmission flag set to true.
*
*/
default io.grpc.stub.StreamObserver readFn(
io.grpc.stub.StreamObserver responseObserver) {
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getReadFnMethod(), responseObserver);
}
/**
*
* AckFn acknowledges a stream of datum offsets.
* When AckFn is called, it implicitly indicates that the datum stream has been processed by the source vertex.
* The caller (numa) expects the AckFn to be successful, and it does not expect any errors.
* If there are some irrecoverable errors when the callee (UDSource) is processing the AckFn request,
* then it is best to crash because there are no other retry mechanisms possible.
* Clients sends n requests and expects n responses.
*
*/
default io.grpc.stub.StreamObserver ackFn(
io.grpc.stub.StreamObserver responseObserver) {
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getAckFnMethod(), responseObserver);
}
/**
*
* PendingFn returns the number of pending records at the user defined source.
*
*/
default void pendingFn(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPendingFnMethod(), responseObserver);
}
/**
*
* PartitionsFn returns the list of partitions for the user defined source.
*
*/
default void partitionsFn(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPartitionsFnMethod(), responseObserver);
}
/**
*
* IsReady is the heartbeat endpoint for user defined source gRPC.
*
*/
default void isReady(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getIsReadyMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service Source.
*/
public static abstract class SourceImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return SourceGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service Source.
*/
public static final class SourceStub
extends io.grpc.stub.AbstractAsyncStub {
private SourceStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected SourceStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new SourceStub(channel, callOptions);
}
/**
*
* Read returns a stream of datum responses.
* The size of the returned responses is less than or equal to the num_records specified in each ReadRequest.
* If the request timeout is reached on the server side, the returned responses will contain all the datum that have been read (which could be an empty list).
* The server will continue to read and respond to subsequent ReadRequests until the client closes the stream.
* Once it has sent all the datum, the server will send a ReadResponse with the end of transmission flag set to true.
*
*/
public io.grpc.stub.StreamObserver readFn(
io.grpc.stub.StreamObserver responseObserver) {
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
getChannel().newCall(getReadFnMethod(), getCallOptions()), responseObserver);
}
/**
*
* AckFn acknowledges a stream of datum offsets.
* When AckFn is called, it implicitly indicates that the datum stream has been processed by the source vertex.
* The caller (numa) expects the AckFn to be successful, and it does not expect any errors.
* If there are some irrecoverable errors when the callee (UDSource) is processing the AckFn request,
* then it is best to crash because there are no other retry mechanisms possible.
* Clients sends n requests and expects n responses.
*
*/
public io.grpc.stub.StreamObserver ackFn(
io.grpc.stub.StreamObserver responseObserver) {
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
getChannel().newCall(getAckFnMethod(), getCallOptions()), responseObserver);
}
/**
*
* PendingFn returns the number of pending records at the user defined source.
*
*/
public void pendingFn(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getPendingFnMethod(), getCallOptions()), request, responseObserver);
}
/**
*
* PartitionsFn returns the list of partitions for the user defined source.
*
*/
public void partitionsFn(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getPartitionsFnMethod(), getCallOptions()), request, responseObserver);
}
/**
*
* IsReady is the heartbeat endpoint for user defined source gRPC.
*
*/
public void isReady(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getIsReadyMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service Source.
*/
public static final class SourceBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private SourceBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected SourceBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new SourceBlockingStub(channel, callOptions);
}
/**
*
* PendingFn returns the number of pending records at the user defined source.
*
*/
public io.numaproj.numaflow.source.v1.SourceOuterClass.PendingResponse pendingFn(com.google.protobuf.Empty request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getPendingFnMethod(), getCallOptions(), request);
}
/**
*
* PartitionsFn returns the list of partitions for the user defined source.
*
*/
public io.numaproj.numaflow.source.v1.SourceOuterClass.PartitionsResponse partitionsFn(com.google.protobuf.Empty request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getPartitionsFnMethod(), getCallOptions(), request);
}
/**
*
* IsReady is the heartbeat endpoint for user defined source gRPC.
*
*/
public io.numaproj.numaflow.source.v1.SourceOuterClass.ReadyResponse isReady(com.google.protobuf.Empty request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getIsReadyMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service Source.
*/
public static final class SourceFutureStub
extends io.grpc.stub.AbstractFutureStub {
private SourceFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected SourceFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new SourceFutureStub(channel, callOptions);
}
/**
*
* PendingFn returns the number of pending records at the user defined source.
*
*/
public com.google.common.util.concurrent.ListenableFuture pendingFn(
com.google.protobuf.Empty request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getPendingFnMethod(), getCallOptions()), request);
}
/**
*
* PartitionsFn returns the list of partitions for the user defined source.
*
*/
public com.google.common.util.concurrent.ListenableFuture partitionsFn(
com.google.protobuf.Empty request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getPartitionsFnMethod(), getCallOptions()), request);
}
/**
*
* IsReady is the heartbeat endpoint for user defined source gRPC.
*
*/
public com.google.common.util.concurrent.ListenableFuture isReady(
com.google.protobuf.Empty request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getIsReadyMethod(), getCallOptions()), request);
}
}
private static final int METHODID_PENDING_FN = 0;
private static final int METHODID_PARTITIONS_FN = 1;
private static final int METHODID_IS_READY = 2;
private static final int METHODID_READ_FN = 3;
private static final int METHODID_ACK_FN = 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 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_PENDING_FN:
serviceImpl.pendingFn((com.google.protobuf.Empty) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_PARTITIONS_FN:
serviceImpl.partitionsFn((com.google.protobuf.Empty) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_IS_READY:
serviceImpl.isReady((com.google.protobuf.Empty) 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_READ_FN:
return (io.grpc.stub.StreamObserver) serviceImpl.readFn(
(io.grpc.stub.StreamObserver) responseObserver);
case METHODID_ACK_FN:
return (io.grpc.stub.StreamObserver) serviceImpl.ackFn(
(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(
getReadFnMethod(),
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
new MethodHandlers<
io.numaproj.numaflow.source.v1.SourceOuterClass.ReadRequest,
io.numaproj.numaflow.source.v1.SourceOuterClass.ReadResponse>(
service, METHODID_READ_FN)))
.addMethod(
getAckFnMethod(),
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
new MethodHandlers<
io.numaproj.numaflow.source.v1.SourceOuterClass.AckRequest,
io.numaproj.numaflow.source.v1.SourceOuterClass.AckResponse>(
service, METHODID_ACK_FN)))
.addMethod(
getPendingFnMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
io.numaproj.numaflow.source.v1.SourceOuterClass.PendingResponse>(
service, METHODID_PENDING_FN)))
.addMethod(
getPartitionsFnMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
io.numaproj.numaflow.source.v1.SourceOuterClass.PartitionsResponse>(
service, METHODID_PARTITIONS_FN)))
.addMethod(
getIsReadyMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
io.numaproj.numaflow.source.v1.SourceOuterClass.ReadyResponse>(
service, METHODID_IS_READY)))
.build();
}
private static abstract class SourceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
SourceBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return io.numaproj.numaflow.source.v1.SourceOuterClass.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Source");
}
}
private static final class SourceFileDescriptorSupplier
extends SourceBaseDescriptorSupplier {
SourceFileDescriptorSupplier() {}
}
private static final class SourceMethodDescriptorSupplier
extends SourceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final java.lang.String methodName;
SourceMethodDescriptorSupplier(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 (SourceGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new SourceFileDescriptorSupplier())
.addMethod(getReadFnMethod())
.addMethod(getAckFnMethod())
.addMethod(getPendingFnMethod())
.addMethod(getPartitionsFnMethod())
.addMethod(getIsReadyMethod())
.build();
}
}
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy