public final class MultiDelete extends RiakCommand<ResponseType,List<Location>>
Riak itself does not support pipelining of requests. MultiDelete addresses this issue by using a thread to parallelize and manage a set of async delete operations for a given set of keys.
The result of executing this command is a List
of RiakFuture
objects, each one representing a single
delete operation. The returned RiakFuture
that contains that list completes
when all the DeleteValue operations contained have finished.
MultiDelete multiDelete = ...; MultiDelete.Response response = client.execute(multiDelete);
The maximum number of concurrent requests defaults to 10. This can be changed when constructing the operation.
Be aware that because requests are being parallelized performance is also dependent on the client's underlying connection pool. If there are no connections available performance will suffer initially as connections will need to be established or worse they could time out.
Be aware that for responsiveness to the caller thread, the requests are run on a Daemon worker thread. Shutting down the client JVM before the future is complete will result in unexpected behavior, and only a subset objects may have been deleted.
Modifier and Type | Class and Description |
---|---|
static class |
MultiDelete.Builder
Used to construct a MultiDelete command.
|
static class |
MultiDelete.Response |
Modifier and Type | Field and Description |
---|---|
protected Map<RiakOption<?>,Object> |
options |
Modifier and Type | Method and Description |
---|---|
protected DeleteValue.Builder |
createBaseBuilderType(Location location) |
protected MultiDelete.Response |
createResponseType(List<RiakFuture<Void,Location>> riakFutures) |
boolean |
equals(Object o) |
protected RiakFuture<ResponseType,List<Location>> |
executeAsync(RiakCluster cluster) |
protected RiakFuture<Void,Location> |
executeBaseCommandAsync(DeleteValue command,
RiakCluster cluster) |
int |
hashCode() |
String |
toString() |
execute, execute
protected final Map<RiakOption<?>,Object> options
protected MultiDelete.Response createResponseType(List<RiakFuture<Void,Location>> riakFutures)
protected DeleteValue.Builder createBaseBuilderType(Location location)
protected RiakFuture<Void,Location> executeBaseCommandAsync(DeleteValue command, RiakCluster cluster)
protected RiakFuture<ResponseType,List<Location>> executeAsync(RiakCluster cluster)
executeAsync
in class RiakCommand<ResponseType extends Iterable<RiakFuture<BaseResponseType,Location>>,List<Location>>
Copyright © 2016. All rights reserved.