Class GetReplicaStrategy.FromIndex

java.lang.Object
com.couchbase.client.java.kv.GetReplicaStrategy
com.couchbase.client.java.kv.GetReplicaStrategy.FromIndex
Enclosing class:
GetReplicaStrategy

public static class GetReplicaStrategy.FromIndex extends GetReplicaStrategy
  • Method Details

    • withWrap

      public GetReplicaStrategy.FromIndex withWrap(boolean wrap)
      Returns a new instance with the specified wrap setting.

      Set wrap to true if you want to efficiently read from a single replica, but don't necessarily care which one.

      When wrap is true:

      • The specified replica index, modulo the actual number of replicas configured on the bucket, is the starting point for a scan of all available replicas; the result may come from a different replica index than the one specified.
      • ReplicaIndexOutOfBoundsException is not thrown unless there are no replicas.
      • ReplicaIndexCurrentlyUnavailableException is not thrown unless all replicas are currently unavailable.

      Default value: false

      Returns:
      a new instance with the given wrap value.
    • toCore

      public CoreGetReplicaStrategy toCore()
      Specified by:
      toCore in class GetReplicaStrategy