public class CoreEnvironment extends Object implements AutoCloseable
Note that unless you are using the core directly, you want to consider the child implementations for each language binding (i.e. the ClusterEnvironment for the java client).
Modifier and Type | Class and Description |
---|---|
static class |
CoreEnvironment.Builder<SELF extends CoreEnvironment.Builder<SELF>> |
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_MAX_NUM_REQUESTS_IN_RETRY
Default maximum requests being queued in retry before performing backpressure cancellations.
|
Modifier | Constructor and Description |
---|---|
protected |
CoreEnvironment(CoreEnvironment.Builder<?> builder) |
Modifier and Type | Method and Description |
---|---|
static CoreEnvironment.Builder<?> |
builder() |
Optional<String> |
clientHash()
If present, returns the git hash for the client at build time.
|
Optional<String> |
clientVersion()
If present, returns the client version at build time.
|
void |
close() |
CompressionConfig |
compressionConfig()
Returns the current compression configuration.
|
Optional<String> |
coreHash()
If present, returns the git hash for the core at build time.
|
Optional<String> |
coreVersion()
If present, returns the core version at build time.
|
static CoreEnvironment |
create() |
protected String |
defaultAgentTitle()
Returns the default user agent name that is used as part of the resulting string.
|
EventBus |
eventBus()
The central event bus which manages all kinds of messages flowing
throughout the client.
|
Executor |
executor()
Returns the executor used to schedule non-reactive async tasks across the SDK.
|
String |
exportAsString(Context.ExportFormat format)
Export this environment into the specified format.
|
IoConfig |
ioConfig()
Returns the current configuration for all I/O-related settings.
|
IoEnvironment |
ioEnvironment()
Holds the environmental configuration/state that is tied to the IO layer.
|
LoggerConfig |
loggerConfig()
Returns the current logger configuration.
|
long |
maxNumRequestsInRetry()
Returns the maximum number of requests allowed in retry, before no more ops are allowed and canceled.
|
Meter |
meter() |
OrphanReporter |
orphanReporter()
Returns the orphan reporter on this environment.
|
List<RequestCallback> |
requestCallbacks() |
RequestTracer |
requestTracer()
Returns the request tracer for response time observability.
|
RetryStrategy |
retryStrategy()
Returns the retry strategy on this environment.
|
Scheduler |
scheduler()
Returns the scheduler used to schedule reactive, async tasks across the SDK.
|
SecurityConfig |
securityConfig()
Returns the current security configuration (TLS etc.).
|
void |
shutdown()
Shuts down this Environment with the default disconnect timeout.
|
void |
shutdown(Duration timeout)
Shuts down this Environment with a custom timeout.
|
CompletableFuture<Void> |
shutdownAsync()
Shuts down this Environment with the default disconnect timeout.
|
CompletableFuture<Void> |
shutdownAsync(Duration timeout)
Shuts down this Environment with a custom timeout.
|
Mono<Void> |
shutdownReactive()
Shuts down this Environment with the default disconnect timeout.
|
Mono<Void> |
shutdownReactive(Duration timeout)
Shuts down this Environment with a custom timeout.
|
TimeoutConfig |
timeoutConfig()
Returns the configuration for all default timeouts.
|
Timer |
timer()
Returns the timer used to schedule timeouts and retries amongst other tasks.
|
String |
toString() |
CoreTransactionsConfig |
transactionsConfig() |
CoreTransactionsSchedulers |
transactionsSchedulers()
The schedulers used for any transactional operations.
|
UserAgent |
userAgent()
User agent used to identify this client against the server.
|
public static final long DEFAULT_MAX_NUM_REQUESTS_IN_RETRY
protected CoreEnvironment(CoreEnvironment.Builder<?> builder)
public static CoreEnvironment create()
public static CoreEnvironment.Builder<?> builder()
protected String defaultAgentTitle()
public Optional<String> clientHash()
public Optional<String> coreHash()
public Optional<String> clientVersion()
public Optional<String> coreVersion()
public UserAgent userAgent()
public EventBus eventBus()
public IoEnvironment ioEnvironment()
public IoConfig ioConfig()
public TimeoutConfig timeoutConfig()
public SecurityConfig securityConfig()
public CompressionConfig compressionConfig()
public LoggerConfig loggerConfig()
public Scheduler scheduler()
@Stability.Internal public Executor executor()
@Stability.Volatile public RequestTracer requestTracer()
Note that this right now is unsupported, volatile API and subject to change!
@Stability.Volatile public Meter meter()
@Stability.Internal public List<RequestCallback> requestCallbacks()
public Timer timer()
public RetryStrategy retryStrategy()
public OrphanReporter orphanReporter()
public long maxNumRequestsInRetry()
@Stability.Volatile public CoreTransactionsConfig transactionsConfig()
@Stability.Volatile public CoreTransactionsSchedulers transactionsSchedulers()
public CompletableFuture<Void> shutdownAsync()
Note that once shutdown, the environment cannot be restarted so it is advised to perform this operation at the very last operation in the SDK shutdown process.
public CompletableFuture<Void> shutdownAsync(Duration timeout)
Note that once shutdown, the environment cannot be restarted so it is advised to perform this operation at the very last operation in the SDK shutdown process.
timeout
- the timeout to wait maximum.public Mono<Void> shutdownReactive()
Note that once shutdown, the environment cannot be restarted so it is advised to perform this operation at the very last operation in the SDK shutdown process.
public Mono<Void> shutdownReactive(Duration timeout)
Note that once shutdown, the environment cannot be restarted so it is advised to perform this operation at the very last operation in the SDK shutdown process.
timeout
- the timeout to wait maximum.public void shutdown(Duration timeout)
Note that once shutdown, the environment cannot be restarted so it is advised to perform this operation at the very last operation in the SDK shutdown process.
timeout
- the timeout to wait maximum.public void shutdown()
Note that once shutdown, the environment cannot be restarted so it is advised to perform this operation at the very last operation in the SDK shutdown process.
public String exportAsString(Context.ExportFormat format)
format
- the format to export into.public void close()
close
in interface AutoCloseable
Copyright © 2024 Couchbase, Inc.. All rights reserved.