@Override @SuppressWarnings("deprecation") public List<ServerDescription> select(final ClusterDescription clusterDescription) { return clusterDescription.getPrimaries(); }
@Override @SuppressWarnings("deprecation") protected List<ServerDescription> chooseForReplicaSet(final ClusterDescription clusterDescription) { return clusterDescription.getPrimaries(); }
@Override @SuppressWarnings("deprecation") public List<ServerDescription> select(final ClusterDescription clusterDescription) { return clusterDescription.getPrimaries(); }
@Override @SuppressWarnings("deprecation") protected List<ServerDescription> chooseForReplicaSet(final ClusterDescription clusterDescription) { List<ServerDescription> selectedServers = super.chooseForReplicaSet(clusterDescription); if (selectedServers.isEmpty()) { selectedServers = clusterDescription.getPrimaries(); } return selectedServers; } }
/** * Gets the address of the current master * * @return the address */ @Deprecated @SuppressWarnings("deprecation") @Nullable public ServerAddress getAddress() { ClusterDescription description = getClusterDescription(); if (description.getPrimaries().isEmpty()) { return null; } return description.getPrimaries().get(0).getAddress(); }
@Override @SuppressWarnings("deprecation") protected List<ServerDescription> chooseForReplicaSet(final ClusterDescription clusterDescription) { List<ServerDescription> selectedServers = selectFreshServers(clusterDescription, clusterDescription.getPrimaries()); if (selectedServers.isEmpty()) { selectedServers = super.chooseForReplicaSet(clusterDescription); } return selectedServers; } }
/** * Gets the ServerAddress of the master server in this replica set. * * @return master or null if don't have one * @throws MongoException if there's a failure */ @SuppressWarnings("deprecation") @Nullable public ServerAddress getMaster() { List<ServerDescription> primaries = getClusterDescription().getPrimaries(); return primaries.isEmpty() ? null : primaries.get(0).getAddress(); }
/** * Gets the maximum size for a BSON object supported by the current master server. Note that this value may change over time depending * on which server is master. * * @return the maximum size, or 0 if not obtained from servers yet. * @throws MongoException if there's a failure */ @SuppressWarnings("deprecation") public int getMaxBsonObjectSize() { List<ServerDescription> primaries = getClusterDescription().getPrimaries(); return primaries.isEmpty() ? ServerDescription.getDefaultMaxDocumentSize() : primaries.get(0).getMaxDocumentSize(); }
/** * Gets the maximum size for a BSON object supported by the current master server. Note that this value may change over time depending * on which server is master. * * @return the maximum size, or 0 if not obtained from servers yet. * @throws MongoException if there's a failure */ @Deprecated @SuppressWarnings("deprecation") public int getMaxBsonObjectSize() { List<ServerDescription> primaries = getClusterDescription().getPrimaries(); return primaries.isEmpty() ? ServerDescription.getDefaultMaxDocumentSize() : primaries.get(0).getMaxDocumentSize(); }
@Override @SuppressWarnings("deprecation") public List<ServerDescription> select(final ClusterDescription clusterDescription) { return clusterDescription.getPrimaries(); }
@Override @SuppressWarnings("deprecation") public List<ServerDescription> select(final ClusterDescription clusterDescription) { return clusterDescription.getPrimaries(); }
@Override @SuppressWarnings("deprecation") protected List<ServerDescription> chooseForReplicaSet(final ClusterDescription clusterDescription) { return clusterDescription.getPrimaries(); }
@Override @SuppressWarnings("deprecation") protected List<ServerDescription> chooseForReplicaSet(final ClusterDescription clusterDescription) { List<ServerDescription> selectedServers = super.chooseForReplicaSet(clusterDescription); if (selectedServers.isEmpty()) { selectedServers = clusterDescription.getPrimaries(); } return selectedServers; } }
/** * Gets the address of the current master * * @return the address */ @Deprecated @SuppressWarnings("deprecation") @Nullable public ServerAddress getAddress() { ClusterDescription description = getClusterDescription(); if (description.getPrimaries().isEmpty()) { return null; } return description.getPrimaries().get(0).getAddress(); }
@Override @SuppressWarnings("deprecation") protected List<ServerDescription> chooseForReplicaSet(final ClusterDescription clusterDescription) { List<ServerDescription> selectedServers = selectFreshServers(clusterDescription, clusterDescription.getPrimaries()); if (selectedServers.isEmpty()) { selectedServers = super.chooseForReplicaSet(clusterDescription); } return selectedServers; } }
/** * Gets the maximum size for a BSON object supported by the current master server. Note that this value may change over time depending * on which server is master. * * @return the maximum size, or 0 if not obtained from servers yet. * @throws MongoException if there's a failure */ @SuppressWarnings("deprecation") public int getMaxBsonObjectSize() { List<ServerDescription> primaries = getClusterDescription().getPrimaries(); return primaries.isEmpty() ? ServerDescription.getDefaultMaxDocumentSize() : primaries.get(0).getMaxDocumentSize(); }
/** * Gets the maximum size for a BSON object supported by the current master server. Note that this value may change over time depending * on which server is master. * * @return the maximum size, or 0 if not obtained from servers yet. * @throws MongoException if there's a failure */ @Deprecated @SuppressWarnings("deprecation") public int getMaxBsonObjectSize() { List<ServerDescription> primaries = getClusterDescription().getPrimaries(); return primaries.isEmpty() ? ServerDescription.getDefaultMaxDocumentSize() : primaries.get(0).getMaxDocumentSize(); }
/** * Gets the ServerAddress of the master server in this replica set. * * @return master or null if don't have one * @throws MongoException if there's a failure */ @SuppressWarnings("deprecation") @Nullable public ServerAddress getMaster() { List<ServerDescription> primaries = getClusterDescription().getPrimaries(); return primaries.isEmpty() ? null : primaries.get(0).getAddress(); }