public static class FetchOperation.Builder extends Object
Constructor and Description |
---|
FetchOperation.Builder(Location location)
Construct a FetchOperation that will retrieve an object from Riak stored
at the provided Location.
|
Modifier and Type | Method and Description |
---|---|
FetchOperation |
build() |
FetchOperation.Builder |
withBasicQuorum(boolean useBasicQuorum)
Set the basic_quorum value.
|
FetchOperation.Builder |
withHeadOnly(boolean headOnly)
Return only the metadata.
|
FetchOperation.Builder |
withIfNotModified(byte[] vclock)
Do not return the object if the supplied vclock matches.
|
FetchOperation.Builder |
withNotFoundOK(boolean notFoundOk)
Set the not_found_ok value.
|
FetchOperation.Builder |
withNVal(int nval)
Set the n_val for this operation.
|
FetchOperation.Builder |
withPr(int pr)
Set the PR value for this query.
|
FetchOperation.Builder |
withR(int r)
Set the R value for this FetchOperation.
|
FetchOperation.Builder |
withReturnDeletedVClock(boolean returnDeletedVClock)
Set whether to return tombstones.
|
FetchOperation.Builder |
withSloppyQuorum(boolean sloppyQuorum)
Set whether to use sloppy_quorum.
|
FetchOperation.Builder |
withTimeout(int timeout)
Set a timeout for this operation.
|
public FetchOperation.Builder(Location location)
location
- the location of the object in Riak to fetch.public FetchOperation.Builder withR(int r)
r
- the R value.public FetchOperation.Builder withPr(int pr)
pr
- the PR value.public FetchOperation.Builder withNotFoundOK(boolean notFoundOk)
If true a vnode returning notfound for a key increments the r tally. False is higher consistency, true is higher availability.
If not asSet the bucket default is used.
notFoundOk
- the not_found_ok value.public FetchOperation.Builder withBasicQuorum(boolean useBasicQuorum)
The parameter controls whether a read request should return early in some fail cases. E.g. If a quorum of nodes has already returned notfound/error, don't wait around for the rest.
useBasicQuorum
- the basic_quorum value.public FetchOperation.Builder withReturnDeletedVClock(boolean returnDeletedVClock)
returnDeletedVClock
- true to return tombstones, false otherwise.public FetchOperation.Builder withHeadOnly(boolean headOnly)
Causes Riak to only return the metadata for the object. The value will be asSet to null.
headOnly
- true to return only metadata.public FetchOperation.Builder withIfNotModified(byte[] vclock)
vclock
- the vclock to match onpublic FetchOperation.Builder withTimeout(int timeout)
timeout
- a timeout in milliseconds.public FetchOperation.Builder withNVal(int nval)
Do not use this unless you understand the ramifications
nval
- the n_val valuepublic FetchOperation.Builder withSloppyQuorum(boolean sloppyQuorum)
Do not use this unless you understand the ramifications
sloppyQuorum
- true to use sloppy_quorumpublic FetchOperation build()
Copyright © 2014. All rights reserved.