Class DefaultCoreEnvironment

java.lang.Object
com.couchbase.client.core.env.DefaultCoreEnvironment
All Implemented Interfaces:
ConfigParserEnvironment, CoreEnvironment, SecureEnvironment

public class DefaultCoreEnvironment
extends Object
implements CoreEnvironment
  • Field Details

    • SSL_ENABLED

      public static final boolean SSL_ENABLED
      See Also:
      Constant Field Values
    • SSL_HOSTNAME_VERIFICATION_ENABLED

      public static final boolean SSL_HOSTNAME_VERIFICATION_ENABLED
      See Also:
      Constant Field Values
    • SSL_KEYSTORE_FILE

      public static final String SSL_KEYSTORE_FILE
    • SSL_TRUSTSTORE_FILE

      public static final String SSL_TRUSTSTORE_FILE
    • SSL_KEYSTORE_PASSWORD

      public static final String SSL_KEYSTORE_PASSWORD
    • SSL_TRUSTSTORE_PASSWORD

      public static final String SSL_TRUSTSTORE_PASSWORD
    • SSL_KEYSTORE

      public static final KeyStore SSL_KEYSTORE
    • SSL_TRUSTSTORE

      public static final KeyStore SSL_TRUSTSTORE
    • BOOTSTRAP_HTTP_ENABLED

      public static final boolean BOOTSTRAP_HTTP_ENABLED
      See Also:
      Constant Field Values
    • BOOTSTRAP_CARRIER_ENABLED

      public static final boolean BOOTSTRAP_CARRIER_ENABLED
      See Also:
      Constant Field Values
    • BOOTSTRAP_HTTP_DIRECT_PORT

      public static final int BOOTSTRAP_HTTP_DIRECT_PORT
      See Also:
      Constant Field Values
    • BOOTSTRAP_HTTP_SSL_PORT

      public static final int BOOTSTRAP_HTTP_SSL_PORT
      See Also:
      Constant Field Values
    • BOOTSTRAP_CARRIER_DIRECT_PORT

      public static final int BOOTSTRAP_CARRIER_DIRECT_PORT
      See Also:
      Constant Field Values
    • BOOTSTRAP_CARRIER_SSL_PORT

      public static final int BOOTSTRAP_CARRIER_SSL_PORT
      See Also:
      Constant Field Values
    • REQUEST_BUFFER_SIZE

      public static final int REQUEST_BUFFER_SIZE
      See Also:
      Constant Field Values
    • RESPONSE_BUFFER_SIZE

      public static final int RESPONSE_BUFFER_SIZE
      See Also:
      Constant Field Values
    • IO_POOL_SIZE

      public static final int IO_POOL_SIZE
    • COMPUTATION_POOL_SIZE

      public static final int COMPUTATION_POOL_SIZE
    • KEYVALUE_ENDPOINTS

      public static final int KEYVALUE_ENDPOINTS
      See Also:
      Constant Field Values
    • VIEW_ENDPOINTS

      public static final int VIEW_ENDPOINTS
      See Also:
      Constant Field Values
    • QUERY_ENDPOINTS

      public static final int QUERY_ENDPOINTS
      See Also:
      Constant Field Values
    • SEARCH_ENDPOINTS

      public static final int SEARCH_ENDPOINTS
      See Also:
      Constant Field Values
    • ANALYTICS_ENDPOINTS

      public static final int ANALYTICS_ENDPOINTS
      See Also:
      Constant Field Values
    • OBSERVE_INTERVAL_DELAY

      public static final Delay OBSERVE_INTERVAL_DELAY
    • RECONNECT_DELAY

      public static final Delay RECONNECT_DELAY
    • RETRY_DELAY

      public static final Delay RETRY_DELAY
    • RETRY_STRATEGY

      public static final RetryStrategy RETRY_STRATEGY
    • MAX_REQUEST_LIFETIME

      public static final long MAX_REQUEST_LIFETIME
    • KEEPALIVEINTERVAL

      public static final long KEEPALIVEINTERVAL
    • CONTINUOUS_KEEPALIVE_ENABLED

      public static final boolean CONTINUOUS_KEEPALIVE_ENABLED
      See Also:
      Constant Field Values
    • KEEPALIVE_ERROR_THRESHOLD

      public static final long KEEPALIVE_ERROR_THRESHOLD
      See Also:
      Constant Field Values
    • KEEPALIVE_TIMEOUT

      public static final long KEEPALIVE_TIMEOUT
      See Also:
      Constant Field Values
    • AUTORELEASE_AFTER

      public static final long AUTORELEASE_AFTER
    • BUFFER_POOLING_ENABLED

      public static final boolean BUFFER_POOLING_ENABLED
      See Also:
      Constant Field Values
    • TCP_NODELAY_ENALED

      public static final boolean TCP_NODELAY_ENALED
      See Also:
      Constant Field Values
    • MUTATION_TOKENS_ENABLED

      public static final boolean MUTATION_TOKENS_ENABLED
      See Also:
      Constant Field Values
    • SOCKET_CONNECT_TIMEOUT

      public static final int SOCKET_CONNECT_TIMEOUT
      See Also:
      Constant Field Values
    • CALLBACKS_ON_IO_POOL

      public static final boolean CALLBACKS_ON_IO_POOL
      See Also:
      Constant Field Values
    • DISCONNECT_TIMEOUT

      public static final long DISCONNECT_TIMEOUT
    • MEMCACHED_HASHING_STRATEGY

      public static final MemcachedHashingStrategy MEMCACHED_HASHING_STRATEGY
    • CONFIG_POLL_INTERVAL

      public static final long CONFIG_POLL_INTERVAL
      See Also:
      Constant Field Values
    • CONFIG_POLL_FLOOR_INTERVAL

      public static final long CONFIG_POLL_FLOOR_INTERVAL
      See Also:
      Constant Field Values
    • CERT_AUTH_ENABLED

      public static final boolean CERT_AUTH_ENABLED
      See Also:
      Constant Field Values
    • FORCE_SASL_PLAIN

      public static final boolean FORCE_SASL_PLAIN
      See Also:
      Constant Field Values
    • OPERATION_TRACING_ENABLED

      public static final boolean OPERATION_TRACING_ENABLED
      See Also:
      Constant Field Values
    • OPERATION_TRACING_SERVER_DUR_ENABLED

      public static final boolean OPERATION_TRACING_SERVER_DUR_ENABLED
      See Also:
      Constant Field Values
    • MIN_COMPRESSION_SIZE

      public static final int MIN_COMPRESSION_SIZE
      See Also:
      Constant Field Values
    • MIN_COMPRESSION_RATIO

      public static final double MIN_COMPRESSION_RATIO
      See Also:
      Constant Field Values
    • COMPRESSION_ENABLED

      public static final boolean COMPRESSION_ENABLED
      See Also:
      Constant Field Values
    • ORPHAN_REPORTING_ENABLED

      public static final boolean ORPHAN_REPORTING_ENABLED
      See Also:
      Constant Field Values
    • NETWORK_RESOLUTION

      public static final NetworkResolution NETWORK_RESOLUTION
    • CORE_VERSION

      public static String CORE_VERSION
    • CORE_GIT_VERSION

      public static String CORE_GIT_VERSION
    • PACKAGE_NAME_AND_VERSION

      public static String PACKAGE_NAME_AND_VERSION
    • USER_AGENT

      public static String USER_AGENT
  • Constructor Details

  • Method Details

    • create

      public static DefaultCoreEnvironment create()
    • builder

      public static DefaultCoreEnvironment.Builder builder()
    • booleanPropertyOr

      protected boolean booleanPropertyOr​(String path, boolean def)
    • stringPropertyOr

      protected String stringPropertyOr​(String path, String def)
    • intPropertyOr

      protected int intPropertyOr​(String path, int def)
    • longPropertyOr

      protected static long longPropertyOr​(String path, long def)
    • doublePropertyOr

      protected static double doublePropertyOr​(String path, double def)
    • ioPool

      public EventLoopGroup ioPool()
      Description copied from interface: CoreEnvironment
      Returns the IO pool for the underlying IO framework, used as the default pool if not overridden for the individual services.
      Specified by:
      ioPool in interface CoreEnvironment
      Returns:
      the default IO pool, shared across resources.
    • shutdown

      public boolean shutdown()
      Description copied from interface: CoreEnvironment
      Shutdown the 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 CoreEnvironment.shutdownAsync().
      Specified by:
      shutdown in interface CoreEnvironment
      Returns:
      returning a boolean, indicating the success of the shutdown.
    • shutdown

      public boolean shutdown​(long timeout, TimeUnit timeUnit)
      Description copied from interface: CoreEnvironment
      Shutdown the 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 CoreEnvironment.shutdownAsync().
      Specified by:
      shutdown in interface CoreEnvironment
      Returns:
      returning a boolean, indicating the success of the shutdown.
    • shutdownAsync

      public rx.Observable<Boolean> shutdownAsync()
      Description copied from interface: CoreEnvironment
      Shutdown the 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.
      Specified by:
      shutdownAsync in interface CoreEnvironment
      Returns:
      an Observable eventually returning a boolean, indicating the success of the shutdown.
    • scheduler

      public rx.Scheduler scheduler()
      Description copied from interface: CoreEnvironment
      Returns the scheduler which should be used for all core actions that need to happen asynchronously.
      Specified by:
      scheduler in interface CoreEnvironment
      Returns:
      the scheduler used for internal operations.
    • sslEnabled

      public boolean sslEnabled()
      Description copied from interface: SecureEnvironment
      Identifies if SSL should be enabled.
      Specified by:
      sslEnabled in interface SecureEnvironment
      Returns:
      true if SSL is enabled, false otherwise.
    • sslKeystoreFile

      public String sslKeystoreFile()
      Description copied from interface: SecureEnvironment
      Identifies the filepath to the ssl keystore. If this method is used without also specifying SecureEnvironment.sslTruststoreFile() this keystore will be used to initialize both the key factory as well as the trust factory with java SSL. This needs to be the case for backwards compatibility, but if you do not need X.509 client cert authentication you might as well just use SecureEnvironment.sslTruststoreFile() alone.
      Specified by:
      sslKeystoreFile in interface SecureEnvironment
      Returns:
      the path to the keystore file.
    • sslKeystorePassword

      public String sslKeystorePassword()
      Description copied from interface: SecureEnvironment
      The password which is used to protect the keystore. Only needed if SecureEnvironment.sslKeystoreFile() is used.
      Specified by:
      sslKeystorePassword in interface SecureEnvironment
      Returns:
      the keystore password.
    • sslKeystore

      public KeyStore sslKeystore()
      Description copied from interface: SecureEnvironment
      Allows to directly configure a KeyStore. If this method is used without also specifying SecureEnvironment.sslTruststore() this keystore will be used to initialize both the key factory as well as the trust factory with java SSL. This needs to be the case for backwards compatibility, but if you do not need X.509 client cert authentication you might as well just use SecureEnvironment.sslTruststore() alone.
      Specified by:
      sslKeystore in interface SecureEnvironment
      Returns:
      the keystore to use.
    • sslTruststoreFile

      public String sslTruststoreFile()
      Description copied from interface: SecureEnvironment
      Identifies the filepath to the ssl TrustManager keystore. If this method is used without also specifying SecureEnvironment.sslKeystoreFile() this keystore will be used to initialize both the key factory as well as the trust factory with java SSL. Prefer this method over the SecureEnvironment.sslKeystoreFile() if you do not need X.509 client auth and just need server side certificate checking.
      Specified by:
      sslTruststoreFile in interface SecureEnvironment
      Returns:
      the path to the truststore file.
    • sslTruststore

      public KeyStore sslTruststore()
      Description copied from interface: SecureEnvironment
      Allows to directly configure a KeyStore. If this method is used without also specifying SecureEnvironment.sslKeystore() this keystore will be used to initialize both the key factory as well as the trust factory with java SSL. Prefer this method over the SecureEnvironment.sslKeystore() if you do not need X.509 client auth and just need server side certificate checking.
      Specified by:
      sslTruststore in interface SecureEnvironment
      Returns:
      the keystore to use when initializing the factory/factories.
    • sslTruststorePassword

      public String sslTruststorePassword()
      Description copied from interface: SecureEnvironment
      The password which is used to protect the TrustManager keystore. Only needed if SecureEnvironment.sslTruststoreFile() is used.
      Specified by:
      sslTruststorePassword in interface SecureEnvironment
      Returns:
      the keystore password.
    • sslHostnameVerificationEnabled

      public boolean sslHostnameVerificationEnabled()
      Description copied from interface: SecureEnvironment
      If set to true, hostname verification is enabled.
      Specified by:
      sslHostnameVerificationEnabled in interface SecureEnvironment
      Returns:
      true if enabled.
    • bootstrapHttpEnabled

      public boolean bootstrapHttpEnabled()
      Description copied from interface: CoreEnvironment
      If bootstrapping through HTTP is enabled.
      Specified by:
      bootstrapHttpEnabled in interface CoreEnvironment
      Returns:
      true if enabled.
    • bootstrapCarrierEnabled

      public boolean bootstrapCarrierEnabled()
      Description copied from interface: CoreEnvironment
      If bootstrapping through the advanced carrier publication is enabled.
      Specified by:
      bootstrapCarrierEnabled in interface CoreEnvironment
      Returns:
      true if enabled.
    • bootstrapHttpDirectPort

      public int bootstrapHttpDirectPort()
      Description copied from interface: CoreEnvironment
      The port to use when bootstrapping through HTTP without SSL.
      Specified by:
      bootstrapHttpDirectPort in interface CoreEnvironment
      Returns:
      the direct http port.
    • bootstrapHttpSslPort

      public int bootstrapHttpSslPort()
      Description copied from interface: CoreEnvironment
      The port to use when bootstrapping through HTTP with SSL.
      Specified by:
      bootstrapHttpSslPort in interface CoreEnvironment
      Returns:
      the https port.
    • bootstrapCarrierDirectPort

      public int bootstrapCarrierDirectPort()
      Description copied from interface: CoreEnvironment
      The port to use when bootstrapping through carrier publication without SSL.
      Specified by:
      bootstrapCarrierDirectPort in interface CoreEnvironment
      Returns:
      the direct carrier publication port.
    • bootstrapCarrierSslPort

      public int bootstrapCarrierSslPort()
      Description copied from interface: CoreEnvironment
      The port to use when bootstrapping through carrier publication with SSL.
      Specified by:
      bootstrapCarrierSslPort in interface CoreEnvironment
      Returns:
      the ssl carrier publication port.
    • ioPoolSize

      public int ioPoolSize()
      Description copied from interface: CoreEnvironment
      Returns the configured IO pool size.
      Specified by:
      ioPoolSize in interface CoreEnvironment
      Returns:
      the pool size (number of threads to use).
    • computationPoolSize

      public int computationPoolSize()
      Description copied from interface: CoreEnvironment
      Returns the pool size (number of threads) for all computation tasks.
      Specified by:
      computationPoolSize in interface CoreEnvironment
      Returns:
      the pool size (number of threads to use).
    • requestBufferSize

      public int requestBufferSize()
      Description copied from interface: CoreEnvironment
      Returns the size of the request ringbuffer.
      Specified by:
      requestBufferSize in interface CoreEnvironment
      Returns:
      the size of the ringbuffer.
    • responseBufferSize

      public int responseBufferSize()
      Description copied from interface: CoreEnvironment
      Returns the size of the response ringbuffer.
      Specified by:
      responseBufferSize in interface CoreEnvironment
      Returns:
      the size of the ringbuffer.
    • kvEndpoints

      public int kvEndpoints()
      Description copied from interface: CoreEnvironment
      The number of key/value service endpoints.
      Specified by:
      kvEndpoints in interface CoreEnvironment
      Returns:
      amount of endpoints per service.
    • viewEndpoints

      public int viewEndpoints()
      Description copied from interface: CoreEnvironment
      The number of view service endpoints.
      Specified by:
      viewEndpoints in interface CoreEnvironment
      Returns:
      amount of endpoints per service.
    • queryEndpoints

      public int queryEndpoints()
      Description copied from interface: CoreEnvironment
      The number of query service endpoints.
      Specified by:
      queryEndpoints in interface CoreEnvironment
      Returns:
      amount of endpoints per service.
    • searchEndpoints

      public int searchEndpoints()
      Description copied from interface: CoreEnvironment
      The number of search service endpoints.
      Specified by:
      searchEndpoints in interface CoreEnvironment
      Returns:
      amount of endpoints per service.
    • coreVersion

      public String coreVersion()
      Description copied from interface: CoreEnvironment
      Returns version information on the core. Version number is in the form MAJOR.MINOR.PATCH, and is the one for the core-io layer.
      Specified by:
      coreVersion in interface CoreEnvironment
      Returns:
      the version string for the core.
      See Also:
      for a more specific build information (relevant for tracking the exact version of the code the core was built from)
    • coreBuild

      public String coreBuild()
      Description copied from interface: CoreEnvironment
      Returns build information on the Couchbase Java SDK core. This has a better granularity than CoreEnvironment.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...
      Specified by:
      coreBuild in interface CoreEnvironment
      Returns:
      the build string for the core.
      See Also:
      for more generic version information.
    • userAgent

      public String userAgent()
      Description copied from interface: CoreEnvironment
      Library identification string, which can be used as User-Agent header in HTTP requests.
      Specified by:
      userAgent in interface CoreEnvironment
      Returns:
      identification string
    • packageNameAndVersion

      public String packageNameAndVersion()
      Description copied from interface: CoreEnvironment
      Returns name and the version of the package. This method used to by @{link userAgent()}.
      Specified by:
      packageNameAndVersion in interface CoreEnvironment
      Returns:
      string containing package name and version
    • observeIntervalDelay

      public Delay observeIntervalDelay()
      Description copied from interface: CoreEnvironment
      Returns the Delay for Observe poll operations.
      Specified by:
      observeIntervalDelay in interface CoreEnvironment
      Returns:
      the observe interval delay.
    • reconnectDelay

      public Delay reconnectDelay()
      Description copied from interface: CoreEnvironment
      Returns the Delay for node reconnects.
      Specified by:
      reconnectDelay in interface CoreEnvironment
      Returns:
      the node reconnect delay.
    • retryDelay

      public Delay retryDelay()
      Description copied from interface: CoreEnvironment
      Returns the Delay for request retries.
      Specified by:
      retryDelay in interface CoreEnvironment
      Returns:
      the request retry delay.
    • retryStrategy

      public RetryStrategy retryStrategy()
      Description copied from interface: CoreEnvironment
      The retry strategy on how to dispatch requests in the failure case.
      Specified by:
      retryStrategy in interface CoreEnvironment
      Returns:
      the retry strategy.
    • maxRequestLifetime

      public long maxRequestLifetime()
      Description copied from interface: CoreEnvironment
      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.
      Specified by:
      maxRequestLifetime in interface CoreEnvironment
      Returns:
      the maximum request lifetime.
    • keepAliveInterval

      public long keepAliveInterval()
      Description copied from interface: CoreEnvironment
      The time in milliseconds after which some service will issue a form of keep-alive request.
      Specified by:
      keepAliveInterval in interface CoreEnvironment
      Returns:
      the interval of idle time in milliseconds after which a keep-alive is triggered.
    • eventBus

      public EventBus eventBus()
      Description copied from interface: CoreEnvironment
      Returns the event bus where events are broadcasted on and can be published to.
      Specified by:
      eventBus in interface CoreEnvironment
      Returns:
      the configured event bus.
    • autoreleaseAfter

      public long autoreleaseAfter()
      Description copied from interface: CoreEnvironment
      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.
      Specified by:
      autoreleaseAfter in interface CoreEnvironment
      Returns:
      the time after which the buffers are released if not subscribed.
    • bufferPoolingEnabled

      public boolean bufferPoolingEnabled()
      Description copied from interface: CoreEnvironment
      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.
      Specified by:
      bufferPoolingEnabled in interface CoreEnvironment
      Returns:
      true if enabled, false otherwise.
    • tcpNodelayEnabled

      public boolean tcpNodelayEnabled()
      Description copied from interface: CoreEnvironment
      Returns true if TCP_NODELAY is enabled (therefore Nagle'ing is disabled).
      Specified by:
      tcpNodelayEnabled in interface CoreEnvironment
      Returns:
      true if enabled.
    • mutationTokensEnabled

      public boolean mutationTokensEnabled()
      Description copied from interface: CoreEnvironment
      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).
      Specified by:
      mutationTokensEnabled in interface CoreEnvironment
      Returns:
      true if enabled on the client side.
    • runtimeMetricsCollector

      public MetricsCollector runtimeMetricsCollector()
      Description copied from interface: CoreEnvironment
      Returns the collector responsible for aggregating and publishing runtime information like gc and memory.
      Specified by:
      runtimeMetricsCollector in interface CoreEnvironment
      Returns:
      the collector.
    • networkLatencyMetricsCollector

      public NetworkLatencyMetricsCollector networkLatencyMetricsCollector()
      Description copied from interface: CoreEnvironment
      Returns the collector responsible for aggregating and publishing network latency information.
      Specified by:
      networkLatencyMetricsCollector in interface CoreEnvironment
      Returns:
      the collector.
    • socketConnectTimeout

      public int socketConnectTimeout()
      Description copied from interface: CoreEnvironment
      Returns the amount of time the SDK will wait on the socket connect until an error is raised and handled.
      Specified by:
      socketConnectTimeout in interface CoreEnvironment
      Returns:
      the socket connect timeout in milliseconds.
    • callbacksOnIoPool

      public boolean callbacksOnIoPool()
      Description copied from interface: CoreEnvironment
      Returns true if the 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.
      Specified by:
      callbacksOnIoPool in interface CoreEnvironment
      Returns:
      true if callbacks are scheduled on the IO event loops.
    • disconnectTimeout

      public long disconnectTimeout()
      Description copied from interface: CoreEnvironment
      The default timeout for disconnect operations, set to DISCONNECT_TIMEOUT.
      Specified by:
      disconnectTimeout in interface CoreEnvironment
      Returns:
      the default disconnect timeout.
    • requestBufferWaitStrategy

      public WaitStrategyFactory requestBufferWaitStrategy()
      Description copied from interface: CoreEnvironment
      Waiting strategy used by request EventProcessors to wait for data from RingBuffer
      Specified by:
      requestBufferWaitStrategy in interface CoreEnvironment
      Returns:
      waiting strategy
    • memcachedHashingStrategy

      public MemcachedHashingStrategy memcachedHashingStrategy()
      Description copied from interface: ConfigParserEnvironment
      Allows to specify a custom strategy to hash memcached bucket documents. If you want to use this SDK side by side with 1.x SDKs on memcached buckets, configure the environment to use the LegacyMemcachedHashingStrategy instead.
      Specified by:
      memcachedHashingStrategy in interface ConfigParserEnvironment
      Returns:
      the memcached hashing strategy.
    • kvIoPool

      public EventLoopGroup kvIoPool()
      Description copied from interface: CoreEnvironment
      If set returns the IO Pool for the KV service, if not returns null.
      Specified by:
      kvIoPool in interface CoreEnvironment
      Returns:
      the KV IO pool if set, null otherwise.
    • viewIoPool

      public EventLoopGroup viewIoPool()
      Description copied from interface: CoreEnvironment
      If set returns the IO Pool for the View service, if not returns null.
      Specified by:
      viewIoPool in interface CoreEnvironment
      Returns:
      the view IO pool if set, null otherwise.
    • queryIoPool

      public EventLoopGroup queryIoPool()
      Description copied from interface: CoreEnvironment
      If set returns the IO Pool for the query service, if not returns null.
      Specified by:
      queryIoPool in interface CoreEnvironment
      Returns:
      the query IO pool if set, null otherwise.
    • searchIoPool

      public EventLoopGroup searchIoPool()
      Description copied from interface: CoreEnvironment
      If set returns the IO Pool for the search service, if not returns null.
      Specified by:
      searchIoPool in interface CoreEnvironment
      Returns:
      the search IO pool if set, null otherwise.
    • analyticsIoPool

      public EventLoopGroup analyticsIoPool()
      Description copied from interface: CoreEnvironment
      If set returns the IO Pool for the analytics service, if not returns null.
      Specified by:
      analyticsIoPool in interface CoreEnvironment
      Returns:
      the analytics IO pool if set, null otherwise.
    • instanceCounter

      public static int instanceCounter()
    • kvServiceConfig

      public KeyValueServiceConfig kvServiceConfig()
      Description copied from interface: CoreEnvironment
      Returns the current service configuration for the KV service. This configuration contains the number of endpoints per node that are to be established by the client. Note that the KV service config is a little less configurable than the HTTP based services since it has different runtime properties in terms of resource utilization and when establishing connections.
      Specified by:
      kvServiceConfig in interface CoreEnvironment
      Returns:
      the current config for the kv service.
    • queryServiceConfig

      public QueryServiceConfig queryServiceConfig()
      Description copied from interface: CoreEnvironment
      Returns the current service configuration for the Query service. This configuration contains settings around minimum and maximum number of endpoints (sockets) per node as well as the idle time until an inactive endpoint is closed.
      Specified by:
      queryServiceConfig in interface CoreEnvironment
      Returns:
      the current config for the query service.
    • viewServiceConfig

      public ViewServiceConfig viewServiceConfig()
      Description copied from interface: CoreEnvironment
      Returns the current service configuration for the View service. This configuration contains settings around minimum and maximum number of endpoints (sockets) per node as well as the idle time until an inactive endpoint is closed.
      Specified by:
      viewServiceConfig in interface CoreEnvironment
      Returns:
      the current config for the view service.
    • searchServiceConfig

      public SearchServiceConfig searchServiceConfig()
      Description copied from interface: CoreEnvironment
      Returns the current service configuration for the Search service. This configuration contains settings around minimum and maximum number of endpoints (sockets) per node as well as the idle time until an inactive endpoint is closed.
      Specified by:
      searchServiceConfig in interface CoreEnvironment
      Returns:
      the current config for the search service.
    • analyticsServiceConfig

      public AnalyticsServiceConfig analyticsServiceConfig()
      Description copied from interface: CoreEnvironment
      Returns the current service configuration for the Analytics service. This configuration contains settings around minimum and maximum number of endpoints (sockets) per node as well as the idle time until an inactive endpoint is closed.
      Specified by:
      analyticsServiceConfig in interface CoreEnvironment
      Returns:
      the current config for the analytics service.
    • configPollInterval

      @Committed @Public public long configPollInterval()
      Description copied from interface: CoreEnvironment
      Returns the proactive polling interval for cluster configurations.
      Specified by:
      configPollInterval in interface CoreEnvironment
      Returns:
      the polling interval in milliseconds.
    • configPollFloorInterval

      @Committed @Public public long configPollFloorInterval()
      Description copied from interface: CoreEnvironment
      Returns the minimum polling interval allowed.
      Specified by:
      configPollFloorInterval in interface CoreEnvironment
      Returns:
      the minimum polling interval.
    • certAuthEnabled

      public boolean certAuthEnabled()
      Description copied from interface: CoreEnvironment
      True if X.509 client certificate authentication is enabled.
      Specified by:
      certAuthEnabled in interface CoreEnvironment
    • continuousKeepAliveEnabled

      public boolean continuousKeepAliveEnabled()
      Description copied from interface: CoreEnvironment
      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.
      Specified by:
      continuousKeepAliveEnabled in interface CoreEnvironment
      Returns:
      true if enabled, false otherwise.
    • keepAliveErrorThreshold

      public long keepAliveErrorThreshold()
      Description copied from interface: CoreEnvironment
      Specifies the number of times a KeepAlive message on a socket can fail before the connection is recycled.
      Specified by:
      keepAliveErrorThreshold in interface CoreEnvironment
      Returns:
      the number of keepalive errors allowed to happen before the socket is reopened.
    • keepAliveTimeout

      public long keepAliveTimeout()
      Description copied from interface: CoreEnvironment
      Specifies the timeout of a keepalive operation on the socket in milliseconds.
      Specified by:
      keepAliveTimeout in interface CoreEnvironment
      Returns:
    • couchbaseCoreSendHook

      public CouchbaseCoreSendHook couchbaseCoreSendHook()
      Description copied from interface: CoreEnvironment
      Returns the CouchbaseCoreSendHook if set, null otherwise.
      Specified by:
      couchbaseCoreSendHook in interface CoreEnvironment
    • forceSaslPlain

      public boolean forceSaslPlain()
      Description copied from interface: CoreEnvironment
      Forces the KeyValue SASL Authentication method to PLAIN if set to true, specifically allowing LDAP-based users to authenticate.
      Specified by:
      forceSaslPlain in interface CoreEnvironment
      Returns:
      true if plain should be forced, false otherwise (default).
    • operationTracingEnabled

      public boolean operationTracingEnabled()
      Description copied from interface: CoreEnvironment
      True if tracing is enabled on the environment.
      Specified by:
      operationTracingEnabled in interface CoreEnvironment
    • operationTracingServerDurationEnabled

      public boolean operationTracingServerDurationEnabled()
      Description copied from interface: CoreEnvironment
      True if additional server duration tracing is enabled.
      Specified by:
      operationTracingServerDurationEnabled in interface CoreEnvironment
    • tracer

      public io.opentracing.Tracer tracer()
      Description copied from interface: CoreEnvironment
      If tracing is enabled, contains the current tracer that should be used.
      Specified by:
      tracer in interface CoreEnvironment
      Returns:
      the tracer to be used.
    • compressionMinSize

      public int compressionMinSize()
      Description copied from interface: CoreEnvironment
      Returns the minimum size of a document to be considered for compression in the first place.
      Specified by:
      compressionMinSize in interface CoreEnvironment
      Returns:
      the minimum size to be considered for compression, in bytes.
    • compressionMinRatio

      public double compressionMinRatio()
      Description copied from interface: CoreEnvironment
      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.
      Specified by:
      compressionMinRatio in interface CoreEnvironment
      Returns:
      the minimum compression ratio for compression
    • compressionEnabled

      public boolean compressionEnabled()
      Description copied from interface: CoreEnvironment
      If true, compression is enabled and will be used if the min size and other thresholds match as well. If false, it won't even be negotiated with the server.
      Specified by:
      compressionEnabled in interface CoreEnvironment
      Returns:
      true if enabled, false otherwise.
    • orphanResponseReportingEnabled

      public boolean orphanResponseReportingEnabled()
      Description copied from interface: CoreEnvironment
      Check if orphan response reporting is enabled. If it is, operations that are not listened to anymore are being fed into the orphan reporter and depending on the implementation (by default) logged.
      Specified by:
      orphanResponseReportingEnabled in interface CoreEnvironment
      Returns:
      true if enabled.
    • orphanResponseReporter

      public OrphanResponseReporter orphanResponseReporter()
      Description copied from interface: CoreEnvironment
      Returns the current orphan response reporter implementation.
      Specified by:
      orphanResponseReporter in interface CoreEnvironment
    • networkResolution

      public NetworkResolution networkResolution()
      Description copied from interface: CoreEnvironment
      Allows to configure the network resolution, default being automatic.
      Specified by:
      networkResolution in interface CoreEnvironment
    • maxAllowedInstances

      public static int maxAllowedInstances()
      Returns the number of maximal allowed instances before warning log will be emitted.
    • maxAllowedInstances

      public static void maxAllowedInstances​(int max)
      Allows to set the maximum allowed instances to higher than 1 to silence warning logs in environments where it can be disregarded.
      Parameters:
      max - the number of envs to allow.
    • dumpParameters

      protected StringBuilder dumpParameters​(StringBuilder sb)
      Dumps the environment parameters known to this implementation into a StringBuilder, which is returned for method chaining.
      Parameters:
      sb - the StringBuilder in which to dump parameters.
      Returns:
      the same StringBuilder for method chaining.
    • toString

      public String toString()
      Overrides:
      toString in class Object