handling failure in RiakCommand#execute

David Byron dbyron at dbyron.com
Fri Nov 13 20:05:38 EST 2015


 From my reading of RiakCommand#execute 
(https://github.com/basho/riak-java-client/blob/develop/src/main/java/com/basho/riak/client/api/RiakCommand.java#L85), 
I'm curious why there's no call to

future.isSuccess()

I can imagine that future.await() throws an exception for all possible 
failures, but then the docs for RiakFuture 
(https://github.com/basho/riak-java-client/blob/develop/src/main/java/com/basho/riak/client/core/RiakFuture.java#L60) 
say:

The typical use pattern is to call await(), check isSuccess(), then call 
getNow() or cause().

Maybe all I'm looking for is a comment in RiakCommand#execute explaining 
why it's not the typical use pattern...but my paranoid self is nervous 
at the moment.

Thanks for helping me understand.

-DB




More information about the riak-users mailing list