|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mongodb.WriteConcern
public class WriteConcern
WriteConcern control the write behavior for with various options, as well as exception raising on error conditions.
w
fsync force fsync to disk
Field Summary | |
---|---|
static WriteConcern |
FSYNC_SAFE
Exceptions are raised for network issues, and server errors and the write operation waits for the server to flush the data to disk |
static WriteConcern |
NONE
No exceptions are raised, even for network issues |
static WriteConcern |
NORMAL
Exceptions are raised for network issues, but not server errors |
static WriteConcern |
REPLICAS_SAFE
Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation |
static WriteConcern |
SAFE
Exceptions are raised for network issues, and server errors; waits on a server for the write operation |
Constructor Summary | |
---|---|
WriteConcern()
|
|
WriteConcern(boolean fsync)
|
|
WriteConcern(int w)
Specifies the number of servers to wait for on the write operation, and exception raising behavior |
|
WriteConcern(int w,
int wtimeout)
Specifies the number of servers to wait for on the write operation, and the amount of time (ms) to wait. |
|
WriteConcern(int w,
int wtimeout,
boolean fsync)
Specifies the number of servers to wait for on the write operation, and the amount of time (ms) to wait. |
Method Summary | |
---|---|
boolean |
callGetLastError()
|
boolean |
fsync()
|
BasicDBObject |
getCommand()
|
int |
getW()
|
int |
getWtimeout()
|
boolean |
raiseNetworkErrors()
|
String |
toString()
|
static WriteConcern |
valueOf(String name)
Get the WriteConcern constants by name: NONE, NORMAL, SAFE, FSYNC_SAFE, REPLICA_SAFE. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final WriteConcern NONE
public static final WriteConcern NORMAL
public static final WriteConcern SAFE
public static final WriteConcern FSYNC_SAFE
public static final WriteConcern REPLICAS_SAFE
Constructor Detail |
---|
public WriteConcern()
public WriteConcern(int w)
Specifies the number of servers to wait for on the write operation, and exception raising behavior
w represents # of servers:
w=-1
None, no checking is donew=0
None, network socket errors raisedw=1
Checks server for errors as well as network socket errors raisedw>1
Checks servers (w) for errors as well as network socket errors raised
public WriteConcern(int w, int wtimeout)
Specifies the number of servers to wait for on the write operation, and the amount of time (ms) to wait.
Note: w should be > 1
public WriteConcern(boolean fsync)
public WriteConcern(int w, int wtimeout, boolean fsync)
Specifies the number of servers to wait for on the write operation, and the amount of time (ms) to wait.
Note: w should be > 1
Method Detail |
---|
public static WriteConcern valueOf(String name)
public BasicDBObject getCommand()
public int getW()
public int getWtimeout()
public boolean fsync()
public boolean raiseNetworkErrors()
public boolean callGetLastError()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |