public class BulkWriteBatchCombiner
extends java.lang.Object
Constructor and Description |
---|
BulkWriteBatchCombiner(ServerAddress serverAddress,
boolean ordered,
WriteConcern writeConcern)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addErrorResult(java.util.List<BulkWriteError> writeErrors,
WriteConcernError writeConcernError,
com.mongodb.internal.connection.IndexMap indexMap)
Add a list of error results and a write concern error
|
void |
addErrorResult(MongoBulkWriteException exception,
com.mongodb.internal.connection.IndexMap indexMap)
Add an error result
|
void |
addResult(BulkWriteResult result,
com.mongodb.internal.connection.IndexMap indexMap)
Add a result
|
void |
addWriteConcernErrorResult(WriteConcernError writeConcernError)
Add a write concern error result
|
void |
addWriteErrorResult(BulkWriteError writeError,
com.mongodb.internal.connection.IndexMap indexMap)
Add a write error result
|
MongoBulkWriteException |
getError()
Gets the combined errors as an exception
|
BulkWriteResult |
getResult()
Gets the combined result.
|
boolean |
hasErrors()
Gets whether there are errors in the combined result.
|
boolean |
shouldStopSendingMoreBatches()
True if ordered and has write errors.
|
public BulkWriteBatchCombiner(ServerAddress serverAddress, boolean ordered, WriteConcern writeConcern)
serverAddress
- the server addressordered
- orderedwriteConcern
- the write concernpublic void addResult(BulkWriteResult result, com.mongodb.internal.connection.IndexMap indexMap)
result
- the resultindexMap
- the index mappublic void addErrorResult(MongoBulkWriteException exception, com.mongodb.internal.connection.IndexMap indexMap)
exception
- the exceptionindexMap
- the index mappublic void addWriteErrorResult(BulkWriteError writeError, com.mongodb.internal.connection.IndexMap indexMap)
writeError
- the write errorindexMap
- the index mappublic void addWriteConcernErrorResult(WriteConcernError writeConcernError)
writeConcernError
- the write concern errorpublic void addErrorResult(java.util.List<BulkWriteError> writeErrors, WriteConcernError writeConcernError, com.mongodb.internal.connection.IndexMap indexMap)
writeErrors
- the errorswriteConcernError
- the write concern errorindexMap
- the index mappublic BulkWriteResult getResult()
public boolean shouldStopSendingMoreBatches()
public boolean hasErrors()
public MongoBulkWriteException getError()