public interface CoreEnvironment extends SecureEnvironment, ConfigParserEnvironment
CoreEnvironment
provides all the core building blocks like environment settings and thread pools so
that the application can work with it properly.
This interface defines the contract. How properties are loaded is chosen by the implementation. See the
DefaultCoreEnvironment
class for the default implementation.
Note that the CoreEnvironment
is stateful, so be sure to call shutdown()
or
shutdownAsync()
properly.Modifier and Type | Method and Description |
---|---|
EventLoopGroup |
analyticsIoPool()
If set returns the IO Pool for the analytics service, if not returns null.
|
AnalyticsServiceConfig |
analyticsServiceConfig()
Returns the current service configuration for the Analytics service.
|
long |
autoreleaseAfter()
The time in milliseconds after which a non-subscribed observable is going to be automatically released.
|
int |
bootstrapCarrierDirectPort()
The port to use when bootstrapping through carrier publication without SSL.
|
boolean |
bootstrapCarrierEnabled()
If bootstrapping through the advanced carrier publication is enabled.
|
int |
bootstrapCarrierSslPort()
The port to use when bootstrapping through carrier publication with SSL.
|
int |
bootstrapHttpDirectPort()
The port to use when bootstrapping through HTTP without SSL.
|
boolean |
bootstrapHttpEnabled()
If bootstrapping through HTTP is enabled.
|
int |
bootstrapHttpSslPort()
The port to use when bootstrapping through HTTP with SSL.
|
boolean |
bufferPoolingEnabled()
Returns if buffer pooling is enabled for greater GC efficiency.
|
boolean |
callbacksOnIoPool()
Returns true if the
Observable callbacks are completed on the IO event loops. |
boolean |
certAuthEnabled()
True if X.509 client certificate authentication is enabled.
|
boolean |
compressionEnabled()
If true, compression is enabled and will be used if the min size and other
thresholds match as well.
|
double |
compressionMinRatio()
If the document is greater than the min compression size it is used
for compression, but only sent if the compressed document has a greater
compression ratio as the one provided.
|
int |
compressionMinSize()
Returns the minimum size of a document to be considered for
compression in the first place.
|
int |
computationPoolSize()
Returns the pool size (number of threads) for all computation tasks.
|
long |
configPollFloorInterval()
Returns the minimum polling interval allowed.
|
long |
configPollInterval()
Returns the proactive polling interval for cluster configurations.
|
boolean |
continuousKeepAliveEnabled()
If set to true, KeepAlives will be sent on a regular basis in the interval also if there
is traffic on the socket, not only if its idle.
|
String |
coreBuild()
Returns build information on the Couchbase Java SDK core.
|
String |
coreVersion()
Returns version information on the core.
|
CouchbaseCoreSendHook |
couchbaseCoreSendHook()
Returns the
CouchbaseCoreSendHook if set, null otherwise. |
long |
disconnectTimeout()
The default timeout for disconnect operations, set to
DefaultCoreEnvironment.DISCONNECT_TIMEOUT . |
EventBus |
eventBus()
Returns the event bus where events are broadcasted on and can be published to.
|
boolean |
forceSaslPlain()
Forces the KeyValue SASL Authentication method to PLAIN if set to true,
specifically allowing LDAP-based users to authenticate.
|
EventLoopGroup |
ioPool()
Returns the IO pool for the underlying IO framework, used as the default pool if not overridden
for the individual services.
|
int |
ioPoolSize()
Returns the configured IO pool size.
|
long |
keepAliveErrorThreshold()
Specifies the number of times a KeepAlive message on a socket can fail before the connection
is recycled.
|
long |
keepAliveInterval()
The time in milliseconds after which some service will issue a form of keep-alive request.
|
long |
keepAliveTimeout()
Specifies the timeout of a keepalive operation on the socket in milliseconds.
|
int |
kvEndpoints()
The number of key/value service endpoints.
|
EventLoopGroup |
kvIoPool()
If set returns the IO Pool for the KV service, if not returns null.
|
KeyValueServiceConfig |
kvServiceConfig()
Returns the current service configuration for the KV service.
|
long |
maxRequestLifetime()
Returns the maximum time in milliseconds a request is allowed to life.
|
boolean |
mutationTokensEnabled()
Returns true if extended mutation tokens are enabled.
|
NetworkLatencyMetricsCollector |
networkLatencyMetricsCollector()
Returns the collector responsible for aggregating and publishing network latency information.
|
NetworkResolution |
networkResolution()
Allows to configure the network resolution, default being automatic.
|
Delay |
observeIntervalDelay()
|
boolean |
operationTracingEnabled()
True if tracing is enabled on the environment.
|
boolean |
operationTracingServerDurationEnabled()
True if additional server duration tracing is enabled.
|
OrphanResponseReporter |
orphanResponseReporter()
Returns the current orphan response reporter implementation.
|
boolean |
orphanResponseReportingEnabled()
Check if orphan response reporting is enabled.
|
String |
packageNameAndVersion()
Returns name and the version of the package.
|
int |
queryEndpoints()
The number of query service endpoints.
|
EventLoopGroup |
queryIoPool()
If set returns the IO Pool for the query service, if not returns null.
|
QueryServiceConfig |
queryServiceConfig()
Returns the current service configuration for the Query service.
|
Delay |
reconnectDelay()
Returns the
Delay for node reconnects. |
int |
requestBufferSize()
Returns the size of the request ringbuffer.
|
WaitStrategyFactory |
requestBufferWaitStrategy()
Waiting strategy used by request
EventProcessor s to wait for data from
RingBuffer |
int |
responseBufferSize()
Returns the size of the response ringbuffer.
|
Delay |
retryDelay()
Returns the
Delay for request retries. |
RetryStrategy |
retryStrategy()
The retry strategy on how to dispatch requests in the failure case.
|
MetricsCollector |
runtimeMetricsCollector()
Returns the collector responsible for aggregating and publishing runtime information like gc and memory.
|
rx.Scheduler |
scheduler()
Returns the scheduler which should be used for all core actions that need to happen
asynchronously.
|
int |
searchEndpoints()
The number of search service endpoints.
|
EventLoopGroup |
searchIoPool()
If set returns the IO Pool for the search service, if not returns null.
|
SearchServiceConfig |
searchServiceConfig()
Returns the current service configuration for the Search service.
|
boolean |
shutdown()
Shutdown the
CoreEnvironment with the default timeout. |
boolean |
shutdown(long timeout,
TimeUnit timeUnit)
Shutdown the
CoreEnvironment with a custom timeout. |
rx.Observable<Boolean> |
shutdownAsync()
Shutdown the
CoreEnvironment in an asynchronous fashion. |
int |
socketConnectTimeout()
Returns the amount of time the SDK will wait on the socket connect until an error is raised and handled.
|
boolean |
tcpNodelayEnabled()
Returns true if TCP_NODELAY is enabled (therefore Nagle'ing is disabled).
|
io.opentracing.Tracer |
tracer()
If tracing is enabled, contains the current tracer that should be used.
|
String |
userAgent()
Library identification string, which can be used as User-Agent header in HTTP requests.
|
int |
viewEndpoints()
The number of view service endpoints.
|
EventLoopGroup |
viewIoPool()
If set returns the IO Pool for the View service, if not returns null.
|
ViewServiceConfig |
viewServiceConfig()
Returns the current service configuration for the View service.
|
sslEnabled, sslHostnameVerificationEnabled, sslKeystore, sslKeystoreFile, sslKeystorePassword, sslTruststore, sslTruststoreFile, sslTruststorePassword
memcachedHashingStrategy
boolean shutdown()
CoreEnvironment
with the default timeout.
Note: If this Environment has been created by the user, it is very important to properly close it, but
only after all the related cluster and bucket resources need to be closed! Once an environment
is shut down, all its contained resources cannot be used any longer!
This method has been converted (after a deprecation phase) from an async method into a synchronous one.
The async version can still be found at shutdownAsync()
.boolean shutdown(long timeout, TimeUnit timeUnit)
CoreEnvironment
with a custom timeout.
Note: If this Environment has been created by the user, it is very important to properly close it, but
only after all the related cluster and bucket resources need to be closed! Once an environment
is shut down, all its contained resources cannot be used any longer!
This method has been converted (after a deprecation phase) from an async method into a synchronous one.
The async version can still be found at shutdownAsync()
.long disconnectTimeout()
DefaultCoreEnvironment.DISCONNECT_TIMEOUT
.rx.Observable<Boolean> shutdownAsync()
CoreEnvironment
in an asynchronous fashion.
Note: If this Environment has been created by the user, it is very important to properly close it, but
only after all the related cluster and bucket resources need to be closed! Once an environment
is shut down, all its contained resources cannot be used any longer!
Since this method is asynchronous and cold, it is important to subscribe to the observable to actually
initiate the shutdown process.Observable
eventually returning a boolean, indicating the success of the shutdown.EventLoopGroup ioPool()
EventLoopGroup kvIoPool()
EventLoopGroup viewIoPool()
EventLoopGroup queryIoPool()
EventLoopGroup searchIoPool()
EventLoopGroup analyticsIoPool()
KeyValueServiceConfig kvServiceConfig()
QueryServiceConfig queryServiceConfig()
ViewServiceConfig viewServiceConfig()
SearchServiceConfig searchServiceConfig()
AnalyticsServiceConfig analyticsServiceConfig()
rx.Scheduler scheduler()
boolean bootstrapHttpEnabled()
boolean bootstrapCarrierEnabled()
int bootstrapHttpDirectPort()
int bootstrapHttpSslPort()
int bootstrapCarrierDirectPort()
int bootstrapCarrierSslPort()
int ioPoolSize()
int computationPoolSize()
Delay observeIntervalDelay()
Delay reconnectDelay()
Delay
for node reconnects.Delay retryDelay()
Delay
for request retries.int requestBufferSize()
int responseBufferSize()
int kvEndpoints()
int viewEndpoints()
int queryEndpoints()
int searchEndpoints()
String coreVersion()
for a more specific build information (relevant for tracking
the exact version of the code the core was built from)
String coreBuild()
coreVersion()
and thus is more relevant to track
the exact version of the code the core was built from.
Build information can contain VCS information like commit numbers, tags, etc...for more generic version information.
String userAgent()
String packageNameAndVersion()
RetryStrategy retryStrategy()
long maxRequestLifetime()
long autoreleaseAfter()
long keepAliveInterval()
@InterfaceAudience.Public @InterfaceStability.Uncommitted boolean continuousKeepAliveEnabled()
@InterfaceAudience.Public @InterfaceStability.Uncommitted long keepAliveErrorThreshold()
@InterfaceAudience.Public @InterfaceStability.Uncommitted long keepAliveTimeout()
EventBus eventBus()
boolean bufferPoolingEnabled()
boolean tcpNodelayEnabled()
boolean mutationTokensEnabled()
MetricsCollector runtimeMetricsCollector()
NetworkLatencyMetricsCollector networkLatencyMetricsCollector()
int socketConnectTimeout()
boolean callbacksOnIoPool()
Observable
callbacks are completed on the IO event loops.
Note: this is an advanced option and must be used with care. It can be used to improve performance since it
removes additional scheduling overhead on the response path, but any blocking calls in the callbacks will
lead to more work on the event loops itself and eventually stall them.@InterfaceStability.Experimental @InterfaceAudience.Public WaitStrategyFactory requestBufferWaitStrategy()
EventProcessor
s to wait for data from
RingBuffer
@InterfaceStability.Committed @InterfaceAudience.Public long configPollInterval()
@InterfaceStability.Committed @InterfaceAudience.Public long configPollFloorInterval()
@InterfaceStability.Uncommitted @InterfaceAudience.Public boolean certAuthEnabled()
@InterfaceStability.Experimental @InterfaceAudience.Public CouchbaseCoreSendHook couchbaseCoreSendHook()
CouchbaseCoreSendHook
if set, null otherwise.boolean forceSaslPlain()
@InterfaceStability.Committed boolean operationTracingEnabled()
@InterfaceStability.Committed boolean operationTracingServerDurationEnabled()
@InterfaceStability.Committed io.opentracing.Tracer tracer()
boolean compressionEnabled()
int compressionMinSize()
double compressionMinRatio()
@InterfaceStability.Committed boolean orphanResponseReportingEnabled()
@InterfaceStability.Committed OrphanResponseReporter orphanResponseReporter()
@InterfaceAudience.Public @InterfaceStability.Uncommitted NetworkResolution networkResolution()
Copyright © 2021 Couchbase, Inc.. All rights reserved.