Package org.apache.beam.sdk.fn.stream
Class OutboundObserverFactory
- java.lang.Object
-
- org.apache.beam.sdk.fn.stream.OutboundObserverFactory
-
public abstract class OutboundObserverFactory extends java.lang.ObjectCreates factories which determine an underlyingStreamObserverimplementation to use in to interact with fn execution APIs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceOutboundObserverFactory.BasicFactory<ReqT,RespT>Creates an outbound observer for the given inbound observer.
-
Constructor Summary
Constructors Constructor Description OutboundObserverFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static OutboundObserverFactoryclientBuffered(java.util.concurrent.ExecutorService executorService)Create a bufferingOutboundObserverFactoryfor client-side RPCs with the specifiedExecutorServiceand the default buffer size.static OutboundObserverFactoryclientBuffered(java.util.concurrent.ExecutorService executorService, int bufferSize)Create a bufferingOutboundObserverFactoryfor client-side RPCs with the specifiedExecutorServiceand buffer size.static OutboundObserverFactoryclientDirect()Create the defaultOutboundObserverFactoryfor client-side RPCs, which uses basic unbuffered flow control.abstract <ReqT,RespT>
org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.StreamObserver<RespT>outboundObserverFor(OutboundObserverFactory.BasicFactory<ReqT,RespT> baseOutboundObserverFactory, org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.StreamObserver<ReqT> inboundObserver)Creates an outbound observer for the given inbound observer by potentially inserting hooks into the inbound and outbound observers.static OutboundObserverFactoryserverDirect()LikeclientDirect()but for server-side RPCs.static OutboundObserverFactorytrivial()Creates anOutboundObserverFactorythat simply delegates to the base factory, with no flow control or synchronization.
-
-
-
Method Detail
-
clientBuffered
public static OutboundObserverFactory clientBuffered(java.util.concurrent.ExecutorService executorService)
Create a bufferingOutboundObserverFactoryfor client-side RPCs with the specifiedExecutorServiceand the default buffer size. AllStreamObservers created by this factory are thread safe.
-
clientBuffered
public static OutboundObserverFactory clientBuffered(java.util.concurrent.ExecutorService executorService, int bufferSize)
Create a bufferingOutboundObserverFactoryfor client-side RPCs with the specifiedExecutorServiceand buffer size. AllStreamObservers created by this factory are thread safe.
-
clientDirect
public static OutboundObserverFactory clientDirect()
Create the defaultOutboundObserverFactoryfor client-side RPCs, which uses basic unbuffered flow control. AllStreamObservers created by this factory are thread safe.
-
serverDirect
public static OutboundObserverFactory serverDirect()
LikeclientDirect()but for server-side RPCs.
-
trivial
public static OutboundObserverFactory trivial()
Creates anOutboundObserverFactorythat simply delegates to the base factory, with no flow control or synchronization. Not recommended for use except in tests.
-
outboundObserverFor
public abstract <ReqT,RespT> org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.StreamObserver<RespT> outboundObserverFor(OutboundObserverFactory.BasicFactory<ReqT,RespT> baseOutboundObserverFactory, org.apache.beam.vendor.grpc.v1p48p1.io.grpc.stub.StreamObserver<ReqT> inboundObserver)
Creates an outbound observer for the given inbound observer by potentially inserting hooks into the inbound and outbound observers.- Parameters:
baseOutboundObserverFactory- A base function to create an outbound observer from an inbound observer.inboundObserver- The inbound observer.
-
-