public class FetchObject<T> extends Object implements RiakOperation<T>
Use Bucket.fetch(String)
methods to create a fetch operation. Also
look at DomainBucket.fetch(Object)
.
Bucket
,
DomainBucket
Constructor and Description |
---|
FetchObject(RawClient client,
String bucket,
String key,
Retrier retrier)
Create a new FetchOperation that delegates to the given
client to fetch the data from bucket at
key using retrier |
FetchObject(RawClient client,
String bucket,
String key,
Retrier retrier,
FetchMeta fetchMeta)
Create a new FetchOperation that delegates to the given
client to fetch the data from bucket at
key using retrier |
Modifier and Type | Method and Description |
---|---|
FetchObject<T> |
basicQuorum(boolean basicQuorum) |
T |
execute()
Attempts to fetch the data at
bucket/key , convert it with
Converter and resolve any siblings with ConflictResolver |
VClock |
getVClock() |
boolean |
hasDeletedVclock()
Deprecated.
|
boolean |
hasVclock() |
FetchObject<T> |
headOnly()
Causes the client to retrieve only the metadata and not the value
of this object.
|
FetchObject<T> |
ifModified(VClock vclock)
*NOTE* PB Only.
|
boolean |
isUnmodified() |
FetchObject<T> |
modifiedSince(Date modifiedSince)
*NOTE* HTTP Only.
|
FetchObject<T> |
notFoundOK(boolean notFoundOK) |
FetchObject<T> |
pr(int pr) |
FetchObject<T> |
pr(Quora pr) |
FetchObject<T> |
pr(Quorum pr) |
FetchObject<T> |
r(int r)
The read quorum for this fetch operation
|
FetchObject<T> |
r(Quora r)
The read quorum for this fetch operation
|
FetchObject<T> |
r(Quorum r)
The read quorum for this fetch operation
|
FetchObject<T> |
returnDeletedVClock(boolean returnDeletedVClock) |
FetchObject<T> |
timeout(int timeout)
Set an operation timeout in milliseconds to be sent to Riak
As of 1.4 Riak allows a timeout to be sent for get, put, and delete operations.
|
FetchObject<T> |
withConverter(Converter<T> converter)
A
Converter to use to convert the data fetched to some other type |
FetchObject<T> |
withResolver(ConflictResolver<T> resolver) |
FetchObject<T> |
withRetrier(Retrier retrier)
A
Retrier to use |
public FetchObject(RawClient client, String bucket, String key, Retrier retrier)
client
to fetch the data from bucket
at
key
using retrier
Use Bucket
to create a Fetch operation, also consider using
DomainBucket
public FetchObject(RawClient client, String bucket, String key, Retrier retrier, FetchMeta fetchMeta)
client
to fetch the data from bucket
at
key
using retrier
Use Bucket
to create a Fetch operation, also consider using
DomainBucket
public T execute() throws UnresolvedConflictException, RiakRetryFailedException, ConversionException
bucket/key
, convert it with
Converter
and resolve any siblings with ConflictResolver
execute
in interface RiakOperation<T>
T
that was stored at
bucket/key
or null if not found.UnresolvedConflictException
- if the ConflictResolver
used cannot get a single
value from any siblingsRiakRetryFailedException
- if the Retrier
fails to execute the operation beyond
some internal boundConversionException
- if the supplied Converter
throws trying to convert
the retrieved value.public FetchObject<T> withResolver(ConflictResolver<T> resolver)
public FetchObject<T> r(int r)
r
- an Integer for the read quorumpublic FetchObject<T> r(Quora r)
r
- an Quora for the read quorumpublic FetchObject<T> r(Quorum r)
r
- an Quorum for the read quorumpublic FetchObject<T> pr(int pr)
pr
- FetchMeta.Builder.pr(int)
public FetchObject<T> pr(Quora pr)
pr
- FetchMeta.Builder.pr(Quora)
public FetchObject<T> pr(Quorum pr)
pr
- FetchMeta.Builder.pr(Quora)
public FetchObject<T> notFoundOK(boolean notFoundOK)
notFoundOK
- FetchMeta.Builder.notFoundOK(boolean)
public FetchObject<T> basicQuorum(boolean basicQuorum)
basicQuorum
- FetchMeta.Builder.basicQuorum(boolean)
public FetchObject<T> timeout(int timeout)
timeout
- the timeout in millisecondspublic FetchObject<T> returnDeletedVClock(boolean returnDeletedVClock)
returnDeletedVClock
- FetchMeta.Builder.returnDeletedVClock(boolean)
public FetchObject<T> modifiedSince(Date modifiedSince)
modifiedSince
- a last modified date.public FetchObject<T> ifModified(VClock vclock)
vclock
- a vclockpublic FetchObject<T> headOnly()
Converter
being used must be able to handle an empty
value.FetchMeta.Builder.headOnly(boolean headOnly)
public FetchObject<T> withConverter(Converter<T> converter)
Converter
to use to convert the data fetched to some other typeconverter
- public FetchObject<T> withRetrier(Retrier retrier)
Retrier
to useretrier
- public boolean isUnmodified()
@Deprecated public boolean hasDeletedVclock()
IRiakObject#isDeleted() }
public boolean hasVclock()
public VClock getVClock()
Copyright © 2013. All Rights Reserved.