public class UpdateCounter extends UpdateDatatype<RiakCounter,UpdateCounter.Response,Location>
To update or create a counter in Riak you construct a CounterUpdate
and use
this command to send it to Riak.
Namespace ns = new Namespace("my_type", "my_bucket");
Location loc = new Location(ns, "my_key");
CounterUpdate update = new CounterUpdate(10L);
UpdateCounter uc = new UpdateCounter.Builder(loc, update).withReturnDatatype(true).build();
UpdateCounter.Response resp = client.execute(uc);
RiakCounter counter = resp.getDatatype();
Modifier and Type | Class and Description |
---|---|
static class |
UpdateCounter.Builder
Builder used to construct an UpdateCounter command.
|
static class |
UpdateCounter.Response
A response from an UpdateCounter command.
|
UpdateDatatype.Option<T>
key, namespace
Modifier and Type | Method and Description |
---|---|
protected RiakFuture<UpdateCounter.Response,Location> |
executeAsync(RiakCluster cluster) |
buildCoreOperation
execute
protected RiakFuture<UpdateCounter.Response,Location> executeAsync(RiakCluster cluster)
executeAsync
in class RiakCommand<UpdateCounter.Response,Location>
Copyright © 2015. All rights reserved.