primary
- Returns:
- ReadPreference which reads from primary only
TaggableReadPreferencefinal List<ServerDescription> choose(ClusterDescription clusterDescription) abstract StringgetName()abstract booleanstatic ReadPreferencenearest()static ReadPreferencestatic TaggableReadPreferencestatic TaggableReadPreferencestatic TaggableReadPreferencestatic TaggableReadPreferencestatic ReadPreferenceprimary()static ReadPreferencestatic ReadPreferenceprimaryPreferred(long maxStaleness,
TimeUnit timeUnit) static TaggableReadPreferenceprimaryPreferred(TagSet tagSet) static TaggableReadPreferenceprimaryPreferred(TagSet tagSet,
long maxStaleness,
TimeUnit timeUnit) static TaggableReadPreferenceprimaryPreferred(List<TagSet> tagSetList) static TaggableReadPreferenceprimaryPreferred(List<TagSet> tagSetList,
long maxStaleness,
TimeUnit timeUnit) static ReadPreferencestatic ReadPreferencestatic TaggableReadPreferencestatic TaggableReadPreferencestatic TaggableReadPreferencestatic TaggableReadPreferencestatic ReadPreferencestatic ReadPreferencesecondaryPreferred(long maxStaleness,
TimeUnit timeUnit) static TaggableReadPreferencesecondaryPreferred(TagSet tagSet) static TaggableReadPreferencesecondaryPreferred(TagSet tagSet,
long maxStaleness,
TimeUnit timeUnit) static TaggableReadPreferencesecondaryPreferred(List<TagSet> tagSetList) static TaggableReadPreferencesecondaryPreferred(List<TagSet> tagSetList,
long maxStaleness,
TimeUnit timeUnit) abstract BsonDocumentstatic ReadPreferencestatic TaggableReadPreferencestatic TaggableReadPreferenceclusterDescription - the cluster descriptionmaxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenessThe 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.
maxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenessThe 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.
*maxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenessThe 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.
maxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenesstagSet - the set of tags to limit the list of secondaries to.tagSet - the set of tags to limit the list of secondaries totagSet - the set of tags to limit the list of secondaries totagSet - the set of tags to limit the list of secondaries toThe 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.
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.timeUnit - the time unit of maxStalenessThe 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.
tagSet - the set of tags to limit the list of secondaries tomaxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenessThe 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.
*tagSet - the set of tags to limit the list of secondaries tomaxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenessThe 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.
tagSet - the set of tags to limit the list of secondaries tomaxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenesstagSetList - the list of tag sets to limit the list of secondaries totagSetList - the list of tag sets to limit the list of secondaries totagSetList - the list of tag sets to limit the list of secondaries totagSetList - the list of tag sets to limit the list of secondaries toThe 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.
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.
tagSetList - the list of tag sets to limit the list of secondaries tomaxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenessThe 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.
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.
tagSetList - the list of tag sets to limit the list of secondaries tomaxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenessThe 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.
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.
tagSetList - the list of tag sets to limit the list of secondaries tomaxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenessThe 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.
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.
tagSetList - the list of tag sets to limit the list of secondaries tomaxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStalenessname - the name of the read preferencename - the name of the read preferencetagSetList - the list of tag setsThe 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.
name - the name of the read preferencetagSetList - the list of tag setsmaxStaleness - the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.timeUnit - the time unit of maxStaleness