public static class MultiFetch.Builder extends Object
Constructor and Description |
---|
MultiFetch.Builder() |
Modifier and Type | Method and Description |
---|---|
MultiFetch.Builder |
addLocation(Location location)
Add a location to the list of locations to retrieve as part of
this multifetch operation.
|
MultiFetch.Builder |
addLocations(Iterable<Location> location)
Add a set of keys to the list of Locations to retrieve as part of
this multifetch operation.
|
MultiFetch.Builder |
addLocations(Location... location)
Add a list of Locations to the list of locations to retrieve as part of
this multifetch operation.
|
MultiFetch |
build()
Build a
MultiFetch operation from this builder |
MultiFetch.Builder |
withMaxInFlight(int maxInFlight)
Set the maximum number of requests to be in progress simultaneously.
|
<U> MultiFetch.Builder |
withOption(FetchValue.Option<U> option,
U value)
A
FetchValue.Option to use with each fetch operation. |
MultiFetch.Builder |
withTimeout(int timeout)
Set the Riak-side timeout value.
|
public MultiFetch.Builder addLocation(Location location)
location
- the location to add.public MultiFetch.Builder addLocations(Location... location)
location
- a list of Locationspublic MultiFetch.Builder addLocations(Iterable<Location> location)
location
- an Iterable set of Locations.public MultiFetch.Builder withMaxInFlight(int maxInFlight)
As noted, Riak does not actually have "MultiFetch" functionality. This operation simulates it by sending multiple fetch requests. This parameter controls how many outstanding requests are allowed simultaneously.
maxInFlight
- the max number of outstanding requests.public <U> MultiFetch.Builder withOption(FetchValue.Option<U> option, U value)
FetchValue.Option
to use with each fetch operation.U
- the type of the option's valueoption
- an optionvalue
- the option's associated valuepublic MultiFetch.Builder withTimeout(int timeout)
By default, riak has a 60s timeout for operations. Setting this value will override that default for each fetch.
timeout
- the timeout in milliseconds to be sent to riak.public MultiFetch build()
MultiFetch
operation from this builderMultiFetch
operationCopyright © 2014. All rights reserved.