|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.basho.riak.client.bucket.FetchBucket
public class FetchBucket
A RiakOperation that gets a Bucket from Riak.
Calls the underlying RiakClients fetch method via the Retrier
attempt method, builds a Bucket from the response.
Example:
final String bucketName = "userAccounts";
// fetch a bucket
Bucket b = client.fetchBucket(bucketName).execute();
// use the bucket
IRiakObject o = b.store("k", "v").execute();
| Constructor Summary | |
|---|---|
FetchBucket(RawClient client,
String bucket,
Retrier retrier)
Create a FetchBucket that delegates to the provided RawClient. |
|
| Method Summary | |
|---|---|
Bucket |
execute()
Execute the fetch operation using the RawClient |
FetchBucket |
lazyLoadBucketProperties()
Prior to the addition of this method there was no way to prevent execute() from fetching the BucketProperties from Riak. |
FetchBucket |
withRetrier(Retrier retrier)
Provide a Retrier to use for the fetch operation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FetchBucket(RawClient client,
String bucket,
Retrier retrier)
RawClient.
client - the RawClient to use when fetching the bucket data.bucket - the name of the bucket to fetch.retrier - the Retrier to use when fetching bucket data.| Method Detail |
|---|
public Bucket execute()
throws RiakRetryFailedException
execute in interface RiakOperation<Bucket>Bucket configured to use this instances RawClient and Retrier for its operations
RiakRetryFailedException - if the Retrier throws RiakRetryFailedExceptionpublic FetchBucket withRetrier(Retrier retrier)
Retrier to use for the fetch operation.
retrier - the Retrier to use
public FetchBucket lazyLoadBucketProperties()
execute() from fetching the BucketProperties from Riak.
Calling this prior to execute() allows you to defer fetching
the bucket properties for this bucket from Riak
until they are required by one of the Bucket methods that
accesses them (e.g. BucketProperties.getR() ). If none of those methods are
called then they are never retrieved.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||