@Immutable public abstract class TaggableReadPreference extends ReadPreference
Modifier and Type | Method and Description |
---|---|
protected List<ServerDescription> |
chooseForNonReplicaSet(ClusterDescription clusterDescription) |
protected static ClusterDescription |
copyClusterDescription(ClusterDescription clusterDescription,
List<ServerDescription> selectedServers) |
boolean |
equals(Object o) |
long |
getMaxStaleness(TimeUnit timeUnit)
Gets the maximum acceptable staleness of a secondary in order to be considered for read operations.
|
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.
|
protected List<ServerDescription> |
selectFreshServers(ClusterDescription clusterDescription,
List<ServerDescription> servers) |
BsonDocument |
toDocument()
Gets a document representing this read preference in the wire protocol.
|
String |
toString() |
choose, chooseForReplicaSet, 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, valueOf
public boolean isSlaveOk()
ReadPreference
isSlaveOk
in class ReadPreference
public BsonDocument toDocument()
ReadPreference
toDocument
in class ReadPreference
public List<TagSet> getTagSetList()
TagSet
instances.public long getMaxStaleness(TimeUnit timeUnit)
timeUnit
- the time unit in which to return the valueprotected List<ServerDescription> chooseForNonReplicaSet(ClusterDescription clusterDescription)
chooseForNonReplicaSet
in class ReadPreference
protected static ClusterDescription copyClusterDescription(ClusterDescription clusterDescription, List<ServerDescription> selectedServers)
protected List<ServerDescription> selectFreshServers(ClusterDescription clusterDescription, List<ServerDescription> servers)