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
CompletionStage
s is done using anDaemonPoolExecutor
so as not to consume or block threads in the Fork Join Pool. TheDaemonPoolExecutor
is 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 class
BaseGrpcServiceImpl.DefaultDependencies
The defaultBaseGrpcServiceImpl.Dependencies
implementation.static interface
BaseGrpcServiceImpl.Dependencies
The dependencies to configure aBaseGrpcServiceImpl
.
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_TRANSFER_THRESHOLD
The default transfer threshold.protected Function<String,ConfigurableCacheFactory>
f_cacheFactorySupplier
The function used to obtain ConfigurableCacheFactory instances for a given scope name.protected BaseGrpcServiceImpl.Dependencies
f_dependencies
The serviceBaseGrpcServiceImpl.Dependencies
.protected Executor
f_executor
TheExecutor
to use to hand off asynchronous tasks.protected GrpcProxyMetrics
f_metrics
The proxy service metrics.protected NamedSerializerFactory
f_serializerProducer
The factory to use to lookup namedSerializer
instances.protected long
transferThreshold
The transfer threshold used for paged requests.protected static Void
VOID
AVoid
value 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 Executor
createDefaultExecutor(String sName)
Create the defaultExecutor
.GrpcProxyMetrics
getMetrics()
Obtain the gRPC metrics instance for this service.protected Serializer
getSerializer(String sFormatRequest, String sFormatProxy, Supplier<Serializer> supplierSerializer, Supplier<ClassLoader> supplierLoader)
-
-
-
Field Detail
-
VOID
protected static final Void VOID
AVoid
value 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 namedSerializer
instances.
-
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.Dependencies
to 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)
-
-