Class IoEnvironment.Builder

java.lang.Object
com.couchbase.client.core.env.IoEnvironment.Builder
Enclosing class:
IoEnvironment

public static class IoEnvironment.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • managerEventLoopGroup

      public IoEnvironment.Builder managerEventLoopGroup(com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup)
      Allows to specify a custom event loop group (I/O event loop thread pool) for the management service.

      Note that you usually do not need to tweak the event loop for the manager service, only if you perform long-running management queries that interfere with regular traffic.

      Note: tweaking the dedicated event loops should be done with care and only after profiling indicated that the default event loop setup is not achieving the desired performance characteristics. Please see the javadoc for the IoEnvironment class for an explanation how the event loops play together for all the services and what effect a custom pool might have.

      Parameters:
      eventLoopGroup - the dedicated event loop group to use.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • kvEventLoopGroup

      public IoEnvironment.Builder kvEventLoopGroup(com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup)
      Allows to specify a custom event loop group (I/O event loop thread pool) for the KV service.

      Note: tweaking the dedicated event loops should be done with care and only after profiling indicated that the default event loop setup is not achieving the desired performance characteristics. Please see the javadoc for the IoEnvironment class for an explanation how the event loops play together for all the services and what effect a custom pool might have.

      Parameters:
      eventLoopGroup - the dedicated event loop group to use.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • queryEventLoopGroup

      public IoEnvironment.Builder queryEventLoopGroup(com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup)
      Allows to specify a custom event loop group (I/O event loop thread pool) for the query service.

      Note: tweaking the dedicated event loops should be done with care and only after profiling indicated that the default event loop setup is not achieving the desired performance characteristics. Please see the javadoc for the IoEnvironment class for an explanation how the event loops play together for all the services and what effect a custom pool might have.

      Parameters:
      eventLoopGroup - the dedicated event loop group to use.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • analyticsEventLoopGroup

      public IoEnvironment.Builder analyticsEventLoopGroup(com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup)
      Allows to specify a custom event loop group (I/O event loop thread pool) for the analytics service.

      Note: tweaking the dedicated event loops should be done with care and only after profiling indicated that the default event loop setup is not achieving the desired performance characteristics. Please see the javadoc for the IoEnvironment class for an explanation how the event loops play together for all the services and what effect a custom pool might have.

      Parameters:
      eventLoopGroup - the dedicated event loop group to use.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • searchEventLoopGroup

      public IoEnvironment.Builder searchEventLoopGroup(com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup)
      Allows to specify a custom event loop group (I/O event loop thread pool) for the search service.

      Note: tweaking the dedicated event loops should be done with care and only after profiling indicated that the default event loop setup is not achieving the desired performance characteristics. Please see the javadoc for the IoEnvironment class for an explanation how the event loops play together for all the services and what effect a custom pool might have.

      Parameters:
      eventLoopGroup - the dedicated event loop group to use.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • eventingEventLoopGroup

      public IoEnvironment.Builder eventingEventLoopGroup(com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup)
      Allows to specify a custom event loop group (I/O event loop thread pool) for the eventing service.

      Note: tweaking the dedicated event loops should be done with care and only after profiling indicated that the default event loop setup is not achieving the desired performance characteristics. Please see the javadoc for the IoEnvironment class for an explanation how the event loops play together for all the services and what effect a custom pool might have.

      Parameters:
      eventLoopGroup - the dedicated event loop group to use.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • backupEventLoopGroup

      @Volatile public IoEnvironment.Builder backupEventLoopGroup(com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup)
      Allows to specify a custom event loop group (I/O event loop thread pool) for the backup service.

      Note: tweaking the dedicated event loops should be done with care and only after profiling indicated that the default event loop setup is not achieving the desired performance characteristics. Please see the javadoc for the IoEnvironment class for an explanation how the event loops play together for all the services and what effect a custom pool might have.

      Parameters:
      eventLoopGroup - the dedicated event loop group to use.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • viewEventLoopGroup

      public IoEnvironment.Builder viewEventLoopGroup(com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup)
      Allows to specify a custom event loop group (I/O event loop thread pool) for the view service.

      Note: tweaking the dedicated event loops should be done with care and only after profiling indicated that the default event loop setup is not achieving the desired performance characteristics. Please see the javadoc for the IoEnvironment class for an explanation how the event loops play together for all the services and what effect a custom pool might have.

      Parameters:
      eventLoopGroup - the dedicated event loop group to use.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • enableNativeIo

      public IoEnvironment.Builder enableNativeIo(boolean nativeIoEnabled)
      If set to false (enabled by default) will force using the java NIO based IO transport.

      Usually the native transports used (epoll on linux and kqueue on OSX) are going to be faster and more efficient than the generic NIO one. We recommend to only set this to false if you experience issues with the native transports or instructed by couchbase support to do so for troubleshooting reasons.

      Parameters:
      nativeIoEnabled - if native IO should be enabled or disabled.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • eventLoopThreadCount

      public IoEnvironment.Builder eventLoopThreadCount(int eventLoopThreadCount)
      Overrides the number of threads used per event loop.

      If not manually overridden, a fair thread count is calculated, see IoEnvironment.fairThreadCount() for more information on the heuristics.

      Note that the count provided will only be used by event loops that the SDK creates. If you configure a custom event loop (i.e. through kvEventLoopGroup(EventLoopGroup)) you are responsible for sizing it appropriately on your own.

      Parameters:
      eventLoopThreadCount - the number of event loops to use per pool.
      Returns:
      this IoEnvironment.Builder for chaining purposes.
    • build

      @Internal public IoEnvironment build()