public final class DefaultWriteResult extends Object implements WriteResult
| Constructor and Description |
|---|
DefaultWriteResult(BulkExecutionException error) |
DefaultWriteResult(Statement<?> statement,
AsyncResultSet rs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Optional<BulkExecutionException> |
getError()
Returns an optional
BulkExecutionException. |
Optional<ExecutionInfo> |
getExecutionInfo() |
Stream<? extends Row> |
getFailedWrites()
If the query that produced this result was a conditional update, but the conditional update
wasn't successful, returns a
Stream containing the failed writes. |
Statement<?> |
getStatement()
Returns the
Statement that has been executed to obtain this result. |
int |
hashCode() |
boolean |
isSuccess()
Returns
true if the statement execution succeeded, false otherwise. |
String |
toString() |
boolean |
wasApplied()
If the query that produced this result was a conditional update, returns whether the
conditional update could be successfully applied.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetBatchSize, getError, getExecutionInfo, getStatement, ifError, isSuccesspublic DefaultWriteResult(@NonNull
Statement<?> statement,
@NonNull
AsyncResultSet rs)
public DefaultWriteResult(@NonNull
BulkExecutionException error)
public boolean wasApplied()
WriteResultIf the query was unsuccessful (i.e., Result.getError() is not empty), then this method
always returns false; if the query was successful but wasn't a conditional update, then
this method always returns true.
wasApplied in interface WriteResulttrue if the conditional update was successfully applied, or if the write wasn't
a conditional update; false otherwise.public Stream<? extends Row> getFailedWrites()
WriteResultStream containing the failed writes.
If the query wasn't a conditional update, or if the conditional update was successful, this method returns an empty stream.
Note that the returned stream will contain one single item for single inserts and updates; only batch inserts and updates can generate a stream of more than one item.
The stream can only be consumed once.
getFailedWrites in interface WriteResultStream containing the failed writes, or an empty stream if no writes failed.public boolean isSuccess()
Resulttrue if the statement execution succeeded, false otherwise.
In case of conditional updates, this method returns true as long as the statement
was executed, even if the conditional update itself could
not be applied.
@NonNull public Statement<?> getStatement()
ResultStatement that has been executed to obtain this result.getStatement in interface Result@NonNull public Optional<BulkExecutionException> getError()
ResultBulkExecutionException. The value is only present if the statement
execution failed, in which case, this exception contains the cause of the failure.getError in interface ResultBulkExecutionException.@NonNull public Optional<ExecutionInfo> getExecutionInfo()
getExecutionInfo in interface ResultCopyright © 2017–2021 DataStax. All rights reserved.