public static final WriteConcern ACKNOWLEDGED
Write operations that use this write concern will wait for acknowledgement, using the default write concern configured on the server.
public static final WriteConcern W1
Write operations that use this write concern will wait for acknowledgement from a single member.
public static final WriteConcern W2
Write operations that use this write concern will wait for acknowledgement from two members.
public static final WriteConcern W3
Write operations that use this write concern will wait for acknowledgement from three members.
public static final WriteConcern UNACKNOWLEDGED
Write operations that use this write concern will return as soon as the message is written to the socket. Exceptions are raised for network issues, but not server errors.
@Deprecated public static final WriteConcern FSYNCED
Write operations wait for the server to flush the data to disk.
public static final WriteConcern JOURNALED
Write operations wait for the server to group commit to the journal file on disk.
@Deprecated public static final WriteConcern REPLICA_ACKNOWLEDGED
Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation.
@Deprecated public static final WriteConcern NORMAL
Write operations that use this write concern will return as soon as the message is written to the socket. Exceptions are raised for network issues, but not server errors.
This field has been superseded by WriteConcern.UNACKNOWLEDGED
, and may be deprecated in a future release.
UNACKNOWLEDGED
@Deprecated public static final WriteConcern SAFE
Write operations that use this write concern will wait for acknowledgement from the primary server before returning. Exceptions are raised for network issues, and server errors.
This field has been superseded by WriteConcern.ACKNOWLEDGED
, and may be deprecated in a future release.
ACKNOWLEDGED
public static final WriteConcern MAJORITY
Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write operation.
@Deprecated public static final WriteConcern FSYNC_SAFE
Exceptions are raised for network issues, and server errors; the write operation waits for the server to flush the data to disk.
This field has been superseded by WriteConcern.FSYNCED
, and may be deprecated in a future release.
FSYNCED
@Deprecated public static final WriteConcern JOURNAL_SAFE
Exceptions are raised for network issues, and server errors; the write operation waits for the server to group commit to the journal file on disk.
This field has been superseded by WriteConcern.JOURNALED
, and may be deprecated in a future release.
@Deprecated public static final WriteConcern REPLICAS_SAFE
Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation.
This field has been superseded by WriteConcern.REPLICA_ACKNOWLEDGED
, and may be deprecated in a future release.
W2
@Deprecated public WriteConcern()
Constructs an instance with all properties initialized to their default values, except for w, which is initialized to 0, making instances constructed this ways equivalent to WriteConcern#UNACKNOWLEDGED
UNACKNOWLEDGED
public WriteConcern(int w)
Construct an instance with the given integer-based value for w.
w
- number of servers to ensure write propagation to before acknowledgment, which must be >= 0
public WriteConcern(String w)
Construct an instance with the given tag set-based value for w.
public WriteConcern(int w, int wTimeoutMS)
Constructs an instance with the given integer-based value for w and the given value for wTimeoutMS.
w
- the w value, which must be >= 0
wTimeoutMS
- the wTimeout in milliseconds, which must be >= 0
@Deprecated public WriteConcern(boolean fsync)
Constructs an instance with the given value for fsync.
fsync
- whether or not to fsync
@Deprecated public WriteConcern(int w, int wTimeoutMS, boolean fsync)
Constructs an instance with the given integer-based w value, wTimeout in milliseconds, and fsync value.
w
- the w value, which must be >= 0
wTimeoutMS
- the wTimeout in milliseconds, which must be >= 0
fsync
- whether or not to fsync
@Deprecated public WriteConcern(int w, int wTimeoutMS, boolean fsync, boolean journal)
Constructs an instance with the given integer-based w value, wTimeout in milliseconds, fsync value, and journal value.
w
- the w value, which must be >= 0
wTimeoutMS
- the wTimeout in milliseconds, which must be >= 0
fsync
- whether or not to fsync
journal
- whether writes should wait for a journaling group commit
@Deprecated public WriteConcern(String w, int wTimeoutMS, boolean fsync, boolean journal)
Constructs an instance with the given String-based w value, wTimeout in milliseconds, fsync value, and journal value.
w
- the w value, which must be non-null
wTimeoutMS
- the wTimeout in milliseconds, which must be >= 0
fsync
- whether or not to fsync
journal
- whether writes should wait for a journaling group commit
public Object getWObject()
Gets the w value.
public int getW()
Gets the w value as an integer.
IllegalStateException
- if w is null or not an integer
public String getWString()
Gets the w parameter as a String.
IllegalStateException
- if w is null or not a String
@Nullable public Integer getWTimeout(TimeUnit timeUnit)
Gets the wTimeout in the given time unit.
timeUnit
- the non-null time unit for the result
@Deprecated public int getWtimeout()
Gets the wTimeout in milliseconds. If wTimeout has not been specified, returns 0.
public Boolean getJournal()
Gets the journal property. The default value is null.
@Deprecated public boolean getJ()
Gets the journal property. If journal has not been specified, returns false.
@Deprecated public boolean getFsync()
Gets the fsync property. If fsync has not been specified, returns false.
@Deprecated public boolean fsync()
Gets the fsync property. If fsync has not been specified, returns false.
@Deprecated public boolean callGetLastError()
Returns true if this write concern indicates that write operations must be acknowledged.
public boolean isServerDefault()
Gets whether this write concern indicates that the server's default write concern will be used.
public BsonDocument asDocument()
Gets this write concern as a document.
w <= 0
public boolean isAcknowledged()
Returns true if this write concern indicates that write operations must be acknowledged.
public static WriteConcern valueOf(String name)
Gets the WriteConcern constants by name (matching is done case insensitively).
name
- the name of the WriteConcern
WriteConcern instance
public WriteConcern withW(int w)
Constructs a new WriteConcern from the current one and the specified integer-based value for w
w
- number of servers to ensure write propagation to before acknowledgment, which must be >= 0
public WriteConcern withW(String w)
Constructs a new WriteConcern from the current one and the specified tag-set based value for w
w
- tag set, or "majority", representing the servers to ensure write propagation to before acknowledgment. Do not use string representation of integer values for w
withW(int)
@Deprecated public WriteConcern withFsync(boolean fsync)
Constructs a new WriteConcern from the current one and the specified fsync value
fsync
- true if the write concern needs to include fsync
public WriteConcern withJournal(Boolean journal)
Constructs a new WriteConcern from the current one and the specified journal value
journal
- true if journalling is required for acknowledgement, false if not, or null if unspecified
@Deprecated public WriteConcern withJ(boolean journal)
Constructs a new WriteConcern from the current one and the specified journal value
journal
- true if journalling is required for acknowledgement
public WriteConcern withWTimeout(long wTimeout, TimeUnit timeUnit)
Constructs a new WriteConcern from the current one and the specified wTimeout in the given time unit.
wTimeout
- the wTimeout, which must be >= 0 and <= Integer.MAX_VALUE after conversion to milliseconds
timeUnit
- the non-null time unit to apply to wTimeout
@Deprecated public static WriteConcern.Majority majorityWriteConcern(int wtimeout, boolean fsync, boolean j)
Create a Majority Write Concern that requires a majority of servers to acknowledge the write.
wtimeout
- timeout for write operation
fsync
- whether or not to fsync
j
- whether writes should wait for a journal group commit
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4