Packages

o

org.mongodb.scala

ReadPreference

object ReadPreference

The preferred replica set members to which a query or command can be sent.

Since

1.0

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReadPreference
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def nearest(tagSetList: Seq[TagSet], maxStaleness: Duration): TaggableReadPreference

    Gets a read preference that forces reads to the primary or a secondary with one of the given sets of tags.

    Gets a read preference that forces reads to the primary or a secondary with one of the given sets of tags. The driver will look for a secondary with each tag set in the given list, stopping after one is found, or the primary if none are available.

    tagSetList

    the list of tag sets to limit the list of secondaries to

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads nearest node respective of tags.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  13. def nearest(tagSetList: Seq[TagSet]): TaggableReadPreference

    Gets a read preference that forces reads to the primary or a secondary with one of the given sets of tags.

    Gets a read preference that forces reads to the primary or a secondary with one of the given sets of tags. The driver will look for a secondary with each tag set in the given list, stopping after one is found, or the primary if none are available.

    tagSetList

    the list of tag sets to limit the list of secondaries to

    returns

    ReadPreference which reads nearest node respective of tags.

  14. def nearest(tagSet: TagSet, maxStaleness: Duration): TaggableReadPreference

    Gets a read preference that forces reads to the primary or a secondary with the given set of tags.

    Gets a read preference that forces reads to the primary or a secondary with the given set of tags.

    tagSet

    the set of tags to limit the list of secondaries to

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads nearest node respective of tags.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  15. def nearest(tagSet: TagSet): TaggableReadPreference

    Gets a read preference that forces reads to the primary or a secondary with the given set of tags.

    Gets a read preference that forces reads to the primary or a secondary with the given set of tags.

    tagSet

    the set of tags to limit the list of secondaries to

    returns

    ReadPreference which reads nearest node respective of tags.

  16. def nearest(maxStaleness: Duration): ReadPreference

    Gets a read preference that forces reads to a primary or a secondary.

    Gets a read preference that forces reads to a primary or a secondary.

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads nearest

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  17. def nearest(): ReadPreference

    Gets a read preference that forces reads to a primary or a secondary.

    Gets a read preference that forces reads to a primary or a secondary.

    returns

    ReadPreference which reads nearest

  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def primary(): ReadPreference

    Gets a read preference that forces read to the primary.

    Gets a read preference that forces read to the primary.

    returns

    ReadPreference which reads from primary only

  21. def primaryPreferred(tagSetList: Seq[TagSet], maxStaleness: Duration): TaggableReadPreference

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary with one of the given sets of tags.

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary with one of the given sets of tags. The driver will look for a secondary with each tag set in the given list, stopping after one is found, or failing if no secondary can be found that matches any of the tag sets in the list.

    tagSetList

    the list of tag sets to limit the list of secondaries to

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads primary if available, otherwise a secondary respective of tags.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  22. def primaryPreferred(tagSetList: Seq[TagSet]): TaggableReadPreference

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary with one of the given sets of tags.

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary with one of the given sets of tags. The driver will look for a secondary with each tag set in the given list, stopping after one is found, or failing if no secondary can be found that matches any of the tag sets in the list.

    tagSetList

    the list of tag sets to limit the list of secondaries to

    returns

    ReadPreference which reads primary if available, otherwise a secondary respective of tags.

  23. def primaryPreferred(tagSet: TagSet, maxStaleness: Duration): TaggableReadPreference

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary with the given set of tags.

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary with the given set of tags.

    tagSet

    the set of tags to limit the list of secondaries to.

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads primary if available, otherwise a secondary respective of tags.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  24. def primaryPreferred(tagSet: TagSet): TaggableReadPreference

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary with the given set of tags.

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary with the given set of tags.

    tagSet

    the set of tags to limit the list of secondaries to.

    returns

    ReadPreference which reads primary if available, otherwise a secondary respective of tags.

  25. def primaryPreferred(maxStaleness: Duration): ReadPreference

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary.

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary.

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads primary if available.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  26. def primaryPreferred(): ReadPreference

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary.

    Gets a read preference that forces reads to the primary if available, otherwise to a secondary.

    returns

    ReadPreference which reads primary if available.

  27. def secondary(tagSetList: Seq[TagSet], maxStaleness: Duration): TaggableReadPreference

    Gets a read preference that forces reads to a secondary with one of the given sets of tags.

    Gets a read preference that forces reads to a secondary with one of the given sets of tags. The driver will look for a secondary with each tag set in the given list, stopping after one is found, or failing if no secondary can be found that matches any of the tag sets in the list.

    tagSetList

    the list of tag sets to limit the list of secondaries to

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads secondary respective of tags.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  28. def secondary(tagSetList: Seq[TagSet]): TaggableReadPreference

    Gets a read preference that forces reads to a secondary with one of the given sets of tags.

    Gets a read preference that forces reads to a secondary with one of the given sets of tags. The driver will look for a secondary with each tag set in the given list, stopping after one is found, or failing if no secondary can be found that matches any of the tag sets in the list.

    tagSetList

    the list of tag sets to limit the list of secondaries to

    returns

    ReadPreference which reads secondary respective of tags.

  29. def secondary(tagSet: TagSet, maxStaleness: Duration): TaggableReadPreference

    Gets a read preference that forces reads to a secondary with the given set of tags.

    Gets a read preference that forces reads to a secondary with the given set of tags.

    tagSet

    the set of tags to limit the list of secondaries to

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads secondary respective of tags.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  30. def secondary(tagSet: TagSet): TaggableReadPreference

    Gets a read preference that forces reads to a secondary with the given set of tags.

    Gets a read preference that forces reads to a secondary with the given set of tags.

    tagSet

    the set of tags to limit the list of secondaries to

    returns

    ReadPreference which reads secondary respective of tags.

  31. def secondary(maxStaleness: Duration): ReadPreference

    Gets a read preference that forces reads to a secondary.

    Gets a read preference that forces reads to a secondary.

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads secondary.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  32. def secondary(): ReadPreference

    Gets a read preference that forces reads to a secondary.

    Gets a read preference that forces reads to a secondary.

    returns

    ReadPreference which reads secondary.

  33. def secondaryPreferred(tagSetList: Seq[TagSet], maxStaleness: Duration): TaggableReadPreference

    Gets a read preference that forces reads to a secondary with one of the given sets of tags.

    Gets a read preference that forces reads to a secondary with one of the given sets of tags. The driver will look for a secondary with each tag set in the given list, stopping after one is found, or the primary if none are available.

    tagSetList

    the list of tag sets to limit the list of secondaries to

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads secondary if available respective of tags, otherwise from primary irrespective of tags.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  34. def secondaryPreferred(tagSetList: Seq[TagSet]): TaggableReadPreference

    Gets a read preference that forces reads to a secondary with one of the given sets of tags.

    Gets a read preference that forces reads to a secondary with one of the given sets of tags. The driver will look for a secondary with each tag set in the given list, stopping after one is found, or the primary if none are available.

    tagSetList

    the list of tag sets to limit the list of secondaries to

    returns

    ReadPreference which reads secondary if available respective of tags, otherwise from primary irrespective of tags.

  35. def secondaryPreferred(tagSet: TagSet, maxStaleness: Duration): TaggableReadPreference

    Gets a read preference that forces reads to a secondary with the given set of tags, or the primary is none are available.

    Gets a read preference that forces reads to a secondary with the given set of tags, or the primary is none are available.

    tagSet

    the set of tags to limit the list of secondaries to

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads secondary if available respective of tags, otherwise from primary irrespective of tags.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  36. def secondaryPreferred(tagSet: TagSet): TaggableReadPreference

    Gets a read preference that forces reads to a secondary with the given set of tags, or the primary is none are available.

    Gets a read preference that forces reads to a secondary with the given set of tags, or the primary is none are available.

    tagSet

    the set of tags to limit the list of secondaries to

    returns

    ReadPreference which reads secondary if available respective of tags, otherwise from primary irrespective of tags.

  37. def secondaryPreferred(maxStaleness: Duration): ReadPreference

    Gets a read preference that forces reads to a secondary if one is available, otherwise to the primary.

    Gets a read preference that forces reads to a secondary if one is available, otherwise to the primary.

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    ReadPreference which reads secondary if available, otherwise from primary.

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  38. def secondaryPreferred(): ReadPreference

    Gets a read preference that forces reads to a secondary if one is available, otherwise to the primary.

    Gets a read preference that forces reads to a secondary if one is available, otherwise to the primary.

    returns

    ReadPreference which reads secondary if available, otherwise from primary.

  39. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  40. def toString(): String
    Definition Classes
    AnyRef → Any
  41. def valueOf(name: String, tagSetList: Seq[TagSet], maxStaleness: Duration): TaggableReadPreference

    Creates a taggable read preference from the given read preference name and list of tag sets.

    Creates a taggable read preference from the given read preference name and list of tag sets.

    name

    the name of the read preference

    tagSetList

    the list of tag sets

    maxStaleness

    the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency plus 10 seconds, whichever is greatest.

    returns

    the taggable read preference

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

  42. def valueOf(name: String, tagSetList: Seq[TagSet]): TaggableReadPreference

    Creates a taggable read preference from the given read preference name and list of tag sets.

    Creates a taggable read preference from the given read preference name and list of tag sets.

    name

    the name of the read preference

    tagSetList

    the list of tag sets

    returns

    the taggable read preference

  43. def valueOf(name: String): ReadPreference

    Creates a read preference from the given read preference name.

    Creates a read preference from the given read preference name.

    name

    the name of the read preference

    returns

    the read preference

  44. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  45. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  46. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped