public interface CoreEnvironment
A 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()
properly.
Modifier and Type | Method and Description |
---|---|
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.
|
int |
computationPoolSize()
Returns the pool size (number of threads) for all computation tasks.
|
boolean |
dcpEnabled()
Identifies if DCP should be enabled.
|
EventBus |
eventBus()
Returns the event bus where events are broadcasted on and can be published to.
|
EventLoopGroup |
ioPool()
Returns the IO pool for the underlying IO framework.
|
int |
ioPoolSize()
Returns the configured IO pool size.
|
long |
keepAliveInterval()
The time in milliseconds after which some service will issue a form of keep-alive request.
|
int |
kvEndpoints()
The number of key/value service endpoints.
|
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.
|
Delay |
observeIntervalDelay()
|
String |
packageNameAndVersion()
Returns name and the version of the package.
|
boolean |
queryEnabled()
Deprecated.
|
int |
queryEndpoints()
The number of query service endpoints.
|
int |
queryPort()
Deprecated.
|
Delay |
reconnectDelay()
Returns the
Delay for node reconnects. |
int |
requestBufferSize()
Returns the size of the request 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.
|
Scheduler |
scheduler()
Returns the scheduler which should be used for all core actions that need to happen asynchronously.
|
Observable<Boolean> |
shutdown()
Shutdown the
CoreEnvironment . |
int |
socketConnectTimeout()
Returns the amount of time the SDK will wait on the socket connect until an error is raised and handled.
|
boolean |
sslEnabled()
Identifies if SSL should be enabled.
|
String |
sslKeystoreFile()
Identifies the filepath to the ssl keystore.
|
String |
sslKeystorePassword()
The password which is used to protect the keystore.
|
boolean |
tcpNodelayEnabled()
Returns true if TCP_NODELAY is enabled (therefore Nagle’ing is disabled).
|
String |
userAgent()
Library identification string, which can be used as User-Agent header in HTTP requests.
|
int |
viewEndpoints()
The number of view service endpoints.
|
Observable<Boolean> shutdown()
Shutdown the CoreEnvironment
.
EventLoopGroup ioPool()
Returns the IO pool for the underlying IO framework.
Scheduler scheduler()
Returns the scheduler which should be used for all core actions that need to happen asynchronously.
boolean dcpEnabled()
Identifies if DCP should be enabled.
boolean sslEnabled()
Identifies if SSL should be enabled.
String sslKeystoreFile()
Identifies the filepath to the ssl keystore.
String sslKeystorePassword()
The password which is used to protect the keystore.
@Deprecated boolean queryEnabled()
True if N1QL querying should be enabled manually, deprecated.
With Couchbase Server 4.0 and onward, it will be automatically detected.
@Deprecated int queryPort()
If manual querying enabled, this defines the N1QL port to use, deprecated.
With Couchbase Server 4.0 and onward, it will be automatically detected.
boolean bootstrapHttpEnabled()
If bootstrapping through HTTP is enabled.
boolean bootstrapCarrierEnabled()
If bootstrapping through the advanced carrier publication is enabled.
int bootstrapHttpDirectPort()
The port to use when bootstrapping through HTTP without SSL.
int bootstrapHttpSslPort()
The port to use when bootstrapping through HTTP with SSL.
int bootstrapCarrierDirectPort()
The port to use when bootstrapping through carrier publication without SSL.
int bootstrapCarrierSslPort()
The port to use when bootstrapping through carrier publication with SSL.
int ioPoolSize()
Returns the configured IO pool size.
int computationPoolSize()
Returns the pool size (number of threads) for all computation tasks.
Delay observeIntervalDelay()
Delay reconnectDelay()
Returns the Delay
for node reconnects.
Delay retryDelay()
Returns the Delay
for request retries.
int requestBufferSize()
Returns the size of the request ringbuffer.
int responseBufferSize()
Returns the size of the response ringbuffer.
int kvEndpoints()
The number of key/value service endpoints.
int viewEndpoints()
The number of view service endpoints.
int queryEndpoints()
The number of query service endpoints.
String userAgent()
Library identification string, which can be used as User-Agent header in HTTP requests.
String packageNameAndVersion()
Returns name and the version of the package. This method used to by @{link userAgent()}.
RetryStrategy retryStrategy()
The retry strategy on how to dispatch requests in the failure case.
long maxRequestLifetime()
Returns the maximum time in milliseconds a request is allowed to life.
If the best effort retry strategy is used, the request will still be cancelled after this period to make sure that requests are not sticking around forever. Make sure it is longer than any timeout you potentially have configured.
long autoreleaseAfter()
The time in milliseconds after which a non-subscribed observable is going to be automatically released.
This prevents accidentally leaking buffers when requested but not consumed by the user.
long keepAliveInterval()
The time in milliseconds after which some service will issue a form of keep-alive request.
EventBus eventBus()
Returns the event bus where events are broadcasted on and can be published to.
boolean bufferPoolingEnabled()
Returns if buffer pooling is enabled for greater GC efficiency.
In general this is always set to true and should only be set to false if there are leaks reported that are not fixable by correcting user level code.
boolean tcpNodelayEnabled()
Returns true if TCP_NODELAY is enabled (therefore Nagle’ing is disabled).
boolean mutationTokensEnabled()
Returns true if extended mutation tokens are enabled.
Note that while this may return true, the server also needs to support it (Couchbase Server 4.0 and above). It will be negotiated during connection setup, but needs to be explicitly enabled on the environment as well to take effect (since it has a 16 bytes overhead on every mutation performed).
MetricsCollector runtimeMetricsCollector()
Returns the collector responsible for aggregating and publishing runtime information like gc and memory.
NetworkLatencyMetricsCollector networkLatencyMetricsCollector()
Returns the collector responsible for aggregating and publishing network latency information.
int socketConnectTimeout()
Returns the amount of time the SDK will wait on the socket connect until an error is raised and handled.
Copyright © 2015 Couchbase, Inc.. All rights reserved.