public final List < ServerDescription > choose ( final ClusterDescription clusterDescription ) { switch ( clusterDescription . getType ( ) ) { case REPLICA_SET : return chooseForReplicaSet ( clusterDescription ) ; case SHARDED : case STANDALONE : return chooseForNonReplicaSet ( clusterDescription ) ; case UNKNOWN : return Collections . emptyList ( ) ; default : throw new UnsupportedOperationException ( "Unsupported cluster type: " + clusterDescription . getType ( ) ) ; } }
Chooses the servers from the given cluster than match this read preference .