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. 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

  2. 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.

  3. 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

  4. 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.

  5. 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

  6. 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

  7. 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

  8. 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

  9. 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.

  10. 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

  11. 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.

  12. 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

  13. 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.

  14. 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

  15. 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.

  16. 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

  17. 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.

  18. 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

  19. 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.

  20. 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

  21. 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.

  22. 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

  23. 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.

  24. 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

  25. 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.

  26. 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

  27. 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

  28. 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