@Immutable public abstract class TaggableReadPreference extends ReadPreference
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.lang.Long |
getMaxStaleness(java.util.concurrent.TimeUnit timeUnit)
Gets the maximum acceptable staleness of a secondary in order to be considered for read operations.
|
java.util.List<TagSet> |
getTagSetList()
Gets the list of tag sets as a list of
TagSet instances. |
int |
hashCode() |
boolean |
isSlaveOk()
True if this read preference allows reading from a secondary member of a replica set.
|
BsonDocument |
toDocument()
Gets a document representing this read preference in the wire protocol.
|
java.lang.String |
toString() |
choose, getName, nearest, nearest, nearest, nearest, nearest, nearest, primary, primaryPreferred, primaryPreferred, primaryPreferred, primaryPreferred, primaryPreferred, primaryPreferred, secondary, secondary, secondary, secondary, secondary, secondary, secondaryPreferred, secondaryPreferred, secondaryPreferred, secondaryPreferred, secondaryPreferred, secondaryPreferred, valueOf, valueOf, valueOfpublic boolean isSlaveOk()
ReadPreferenceisSlaveOk in class ReadPreferencepublic BsonDocument toDocument()
ReadPreferencetoDocument in class ReadPreferencepublic java.util.List<TagSet> getTagSetList()
TagSet instances.@Nullable public java.lang.Long getMaxStaleness(java.util.concurrent.TimeUnit timeUnit)
The maximum staleness feature is designed to prevent badly-lagging servers from being selected. The staleness estimate is imprecise and shouldn't be used to try to select "up-to-date" secondaries.
The driver estimates the staleness of each secondary, based on lastWriteDate values provided in server isMaster responses, and selects only those secondaries whose staleness is less than or equal to maxStaleness.
timeUnit - the time unit in which to return the valuepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2010 - 2023 Adobe. All Rights Reserved