public class EmptyWriteResult extends Object implements WriteResult
| Constructor and Description |
|---|
EmptyWriteResult(Statement<?> s) |
| Modifier and Type | Method and Description |
|---|---|
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. |
boolean |
wasApplied()
If the query that produced this result was a conditional update, returns whether the
conditional update could be successfully applied.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBatchSize, ifError, isSuccesspublic EmptyWriteResult(Statement<?> s)
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.@NonNull public Statement<?> getStatement()
ResultStatement that has been executed to obtain this result.getStatement in interface Result@NonNull public Optional<ExecutionInfo> getExecutionInfo()
getExecutionInfo 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.Copyright © 2017–2021 DataStax. All rights reserved.