public class BulkWriteBatchCombiner extends Object
Constructor and Description |
---|
BulkWriteBatchCombiner(ServerAddress serverAddress,
boolean ordered,
WriteConcern writeConcern)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addErrorResult(List<BulkWriteError> writeErrors,
WriteConcernError writeConcernError,
IndexMap indexMap)
Add a list of error results and a write concern error
|
void |
addErrorResult(MongoBulkWriteException exception,
IndexMap indexMap)
Add an error result
|
void |
addResult(BulkWriteResult result,
IndexMap indexMap)
Add a result
|
void |
addWriteConcernErrorResult(WriteConcernError writeConcernError)
Add a write concern error result
|
void |
addWriteErrorResult(BulkWriteError writeError,
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, IndexMap indexMap)
result
- the resultindexMap
- the index mappublic void addErrorResult(MongoBulkWriteException exception, IndexMap indexMap)
exception
- the exceptionindexMap
- the index mappublic void addWriteErrorResult(BulkWriteError writeError, IndexMap indexMap)
writeError
- the write errorindexMap
- the index mappublic void addWriteConcernErrorResult(WriteConcernError writeConcernError)
writeConcernError
- the write concern errorpublic void addErrorResult(List<BulkWriteError> writeErrors, WriteConcernError writeConcernError, IndexMap indexMap)
writeErrors
- the errorswriteConcernError
- the write concern errorindexMap
- the index mappublic BulkWriteResult getResult()
public boolean shouldStopSendingMoreBatches()
public boolean hasErrors()
public MongoBulkWriteException getError()