/** * Construct a defaulted connection description instance. * * @param serverId the server address */ public ConnectionDescription(final ServerId serverId) { this(new ConnectionId(serverId), new ServerVersion(), 0, ServerType.UNKNOWN, DEFAULT_MAX_WRITE_BATCH_SIZE, getDefaultMaxDocumentSize(), DEFAULT_MAX_MESSAGE_SIZE, Collections.<String>emptyList()); }
/** * 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(); }
private static int getMaxBsonObjectSize(final BsonDocument isMasterResult) { return isMasterResult.getInt32("maxBsonObjectSize", new BsonInt32(getDefaultMaxDocumentSize())).getValue(); }
/** * Construct a defaulted connection description instance. * * @param serverId the server address */ public ConnectionDescription(final ServerId serverId) { this(new ConnectionId(serverId), new ServerVersion(), 0, ServerType.UNKNOWN, DEFAULT_MAX_WRITE_BATCH_SIZE, getDefaultMaxDocumentSize(), DEFAULT_MAX_MESSAGE_SIZE, Collections.<String>emptyList()); }
/** * 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 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(); }
private static int getMaxBsonObjectSize(final BsonDocument isMasterResult) { return isMasterResult.getInt32("maxBsonObjectSize", new BsonInt32(getDefaultMaxDocumentSize())).getValue(); }