Package com.oracle.coherence.grpc.proxy
Class BaseGrpcServiceImpl
- java.lang.Object
-
- com.oracle.coherence.grpc.proxy.BaseGrpcServiceImpl
-
- Direct Known Subclasses:
NamedCacheServiceImpl
public class BaseGrpcServiceImpl extends Object
A base class for gRPC services.The asynchronous processing of
CompletionStages is done using anDaemonPoolExecutorso as not to consume or block threads in the Fork Join Pool. TheDaemonPoolExecutoris configurable so that its thread counts can be controlled.- Since:
- 23.03
- Author:
- Jonathan Knight 2023.02.03
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseGrpcServiceImpl.DefaultDependenciesThe defaultBaseGrpcServiceImpl.Dependenciesimplementation.static interfaceBaseGrpcServiceImpl.DependenciesThe dependencies to configure aBaseGrpcServiceImpl.
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_TRANSFER_THRESHOLDThe default transfer threshold.protected Function<String,ConfigurableCacheFactory>f_cacheFactorySupplierThe function used to obtain ConfigurableCacheFactory instances for a given scope name.protected BaseGrpcServiceImpl.Dependenciesf_dependenciesThe serviceBaseGrpcServiceImpl.Dependencies.protected Executorf_executorTheExecutorto use to hand off asynchronous tasks.protected GrpcProxyMetricsf_metricsThe proxy service metrics.protected NamedSerializerFactoryf_serializerProducerThe factory to use to lookup namedSerializerinstances.protected longtransferThresholdThe transfer threshold used for paged requests.protected static VoidVOIDAVoidvalue to make it obvious the return value in Void methods.
-
Constructor Summary
Constructors Constructor Description BaseGrpcServiceImpl(BaseGrpcServiceImpl.Dependencies dependencies, String sMBeanName, String sPoolName)Create aBaseGrpcServiceImpl.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static ExecutorcreateDefaultExecutor(String sName)Create the defaultExecutor.GrpcProxyMetricsgetMetrics()Obtain the gRPC metrics instance for this service.protected SerializergetSerializer(String sFormatRequest, String sFormatProxy, Supplier<Serializer> supplierSerializer, Supplier<ClassLoader> supplierLoader)
-
-
-
Field Detail
-
VOID
protected static final Void VOID
AVoidvalue to make it obvious the return value in Void methods.
-
DEFAULT_TRANSFER_THRESHOLD
public static final long DEFAULT_TRANSFER_THRESHOLD
The default transfer threshold.- See Also:
- Constant Field Values
-
f_dependencies
protected final BaseGrpcServiceImpl.Dependencies f_dependencies
The serviceBaseGrpcServiceImpl.Dependencies.
-
f_cacheFactorySupplier
protected final Function<String,ConfigurableCacheFactory> f_cacheFactorySupplier
The function used to obtain ConfigurableCacheFactory instances for a given scope name.
-
f_serializerProducer
protected final NamedSerializerFactory f_serializerProducer
The factory to use to lookup namedSerializerinstances.
-
f_metrics
protected final GrpcProxyMetrics f_metrics
The proxy service metrics.
-
transferThreshold
protected long transferThreshold
The transfer threshold used for paged requests.
-
-
Constructor Detail
-
BaseGrpcServiceImpl
public BaseGrpcServiceImpl(BaseGrpcServiceImpl.Dependencies dependencies, String sMBeanName, String sPoolName)
Create aBaseGrpcServiceImpl.- Parameters:
dependencies- theBaseGrpcServiceImpl.Dependenciesto use to configure the service
-
-
Method Detail
-
getMetrics
public GrpcProxyMetrics getMetrics()
Obtain the gRPC metrics instance for this service.- Returns:
- the gRPC metrics instance for this service
-
createDefaultExecutor
protected static Executor createDefaultExecutor(String sName)
Create the defaultExecutor.- Returns:
- the default
Executor
-
getSerializer
protected Serializer getSerializer(String sFormatRequest, String sFormatProxy, Supplier<Serializer> supplierSerializer, Supplier<ClassLoader> supplierLoader)
-
-