|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.basho.riak.client.bucket.WriteBucket
public class WriteBucket
A RiakOperation for creating/updating a Bucket.
This class is a fluid builder for creating a RiakOperation that sets
bucket properties on a bucket in Riak. It delegates to a
BucketPropertiesBuilder then uses its RawClient and
Retrier to set the bucket properties in Riak.
NOTE: all the parameters on the builder are optional. If omitted then the Riak defaults will be used. Also, very few of these properties are supported by both underlying APIs at present. They are here for completeness sake. Changes are underway to support all the properties. Check the docs for the individual parameters to see what is supported.
| Constructor Summary | |
|---|---|
WriteBucket(RawClient client,
Bucket bucket,
Retrier retrier)
Create WriteBucket operation that delegates to the given RawClient via the give Retrier. |
|
WriteBucket(RawClient client,
String name,
Retrier retrier)
Create WriteBucket operation that delegates to the given RawClient via the give Retrier. |
|
| Method Summary | |
|---|---|
WriteBucket |
addPostcommitHook(NamedErlangFunction postcommitHook)
Add a postcommit hook to the Collection of post commit hooks for the bucket to written. |
WriteBucket |
addPrecommitHook(NamedFunction preCommitHook)
Add a precommit hook to the Collection of hooks to be written. |
WriteBucket |
allowSiblings(boolean allowSiblings)
Should the bucket have allow_mult set to true? |
WriteBucket |
backend(String backend)
Which backend this bucket uses. |
WriteBucket |
basicQuorum(boolean basicQuorum)
The default basic_quorum value NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
bigVClock(int bigVClock)
set the big_vclock prune size NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
chashKeyFunction(NamedErlangFunction chashKeyFunction)
Set the chash_key_fun on the bucket to be written NOTE: at present this is not supported by the PB API and has no effect for that client. |
WriteBucket |
disableSearch()
convenience for setting search=false **and** removing the search precommit hook (support for both pre-1.0 and 1.0 search) NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that
transport |
WriteBucket |
dw(int dw)
The default dw quorom as an int NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
dw(Quora dw)
The default dw quorom NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
enableForSearch()
convenience for setting search=true **and** adding the search precommit hook (support for both pre-1.0 and 1.0 search) NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
Bucket |
execute()
Creates/updates a Bucket in Riak with the set of properties configured. |
WriteBucket |
lastWriteWins(boolean lastWriteWins)
Is this bucket last_write_wins? NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport. |
WriteBucket |
lazyLoadBucketProperties()
Prior to the addition of this method there was no way to prevent execute() from fetching the BucketProperties from Riak
after storing any modifications made via this object. |
WriteBucket |
linkWalkFunction(NamedErlangFunction linkWalkFunction)
Set the link_walk_fun used by Riak on the bucket to be written. |
WriteBucket |
notFoundOK(boolean notFoundOK)
The default notfound_ok value NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
nVal(int nVal)
The n_val for this bucket |
WriteBucket |
oldVClock(long oldVClock)
set the old_vclock prune age NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
postcommitHooks(Collection<NamedErlangFunction> postCommitHooks)
Add a collection of postcommit hooks to the bucket to be written. |
WriteBucket |
pr(int pr)
The default pr quorom as an int NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
pr(Quora pr)
The default pr quorom NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
precommitHooks(Collection<NamedFunction> precommitHooks)
A Collection of precommit hooks for this bucket NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
pw(int pw)
The default dw quorom as an int NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
pw(Quora pw)
The default pw quorom NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
r(int r)
The default r quorom as an int NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
r(Quora r)
The default r Quorom for the bucket NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
rw(int rw)
The default rw quorom as an int NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
rw(Quora rw)
The default rw quorom NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
smallVClock(int smallVClock)
set the small vclock prune size NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
w(int w)
The default w quorom as an int NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
w(Quora w)
The default w quorom NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
WriteBucket |
withRetrier(Retrier retrier)
Specify the retrier to use for this operation. |
WriteBucket |
youngVClock(long youngVClock)
set the young_vclock prune age NOTE: at present this is not supported by PB API and an UnsupportedPropertyException will be thrown if called for that transport |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WriteBucket(RawClient client,
String name,
Retrier retrier)
RawClient via the give Retrier.
client - the RawClient to delegate toname - the name of the bucket to create/updateretrier - the Retrier to use
public WriteBucket(RawClient client,
Bucket bucket,
Retrier retrier)
RawClient via the give Retrier.
client - the RawClient to delegate tobucket - the bucket to updateretrier - the Retrier to use| Method Detail |
|---|
public Bucket execute()
throws RiakRetryFailedException
execute in interface RiakOperation<Bucket>Bucket
RiakRetryFailedExceptionpublic WriteBucket allowSiblings(boolean allowSiblings)
allowSiblings -
public WriteBucket lastWriteWins(boolean lastWriteWins)
UnsupportedPropertyException will be thrown if called for that transport.
lastWriteWins -
public WriteBucket nVal(int nVal)
nVal -
public WriteBucket backend(String backend)
UnsupportedPropertyException will be thrown if called for that transport
backend -
public WriteBucket precommitHooks(Collection<NamedFunction> precommitHooks)
UnsupportedPropertyException will be thrown if called for that transport
precommitHooks -
public WriteBucket addPrecommitHook(NamedFunction preCommitHook)
UnsupportedPropertyException will be thrown if called for that transport
preCommitHook -
public WriteBucket postcommitHooks(Collection<NamedErlangFunction> postCommitHooks)
UnsupportedPropertyException will be thrown if called for that transport
postCommitHooks -
public WriteBucket addPostcommitHook(NamedErlangFunction postcommitHook)
UnsupportedPropertyException will be thrown if called for that transport
postcommitHook -
public WriteBucket chashKeyFunction(NamedErlangFunction chashKeyFunction)
chashKeyFunction -
public WriteBucket linkWalkFunction(NamedErlangFunction linkWalkFunction)
linkWalkFunction -
public WriteBucket smallVClock(int smallVClock)
UnsupportedPropertyException will be thrown if called for that transport
smallVClock -
public WriteBucket bigVClock(int bigVClock)
UnsupportedPropertyException will be thrown if called for that transport
bigVClock -
public WriteBucket youngVClock(long youngVClock)
UnsupportedPropertyException will be thrown if called for that transport
youngVClock -
public WriteBucket oldVClock(long oldVClock)
UnsupportedPropertyException will be thrown if called for that transport
oldVClock -
public WriteBucket r(Quora r)
UnsupportedPropertyException will be thrown if called for that transport
r -
public WriteBucket r(int r)
UnsupportedPropertyException will be thrown if called for that transport
r -
public WriteBucket w(Quora w)
UnsupportedPropertyException will be thrown if called for that transport
w -
public WriteBucket w(int w)
UnsupportedPropertyException will be thrown if called for that transport
w -
public WriteBucket rw(Quora rw)
UnsupportedPropertyException will be thrown if called for that transport
rw -
public WriteBucket rw(int rw)
UnsupportedPropertyException will be thrown if called for that transport
rw -
public WriteBucket dw(Quora dw)
UnsupportedPropertyException will be thrown if called for that transport
dw -
public WriteBucket dw(int dw)
UnsupportedPropertyException will be thrown if called for that transport
dw -
public WriteBucket pr(Quora pr)
UnsupportedPropertyException will be thrown if called for that transport
pr -
public WriteBucket pr(int pr)
UnsupportedPropertyException will be thrown if called for that transport
pr -
public WriteBucket pw(Quora pw)
UnsupportedPropertyException will be thrown if called for that transport
pw -
public WriteBucket pw(int pw)
UnsupportedPropertyException will be thrown if called for that transport
dw -
public WriteBucket basicQuorum(boolean basicQuorum)
UnsupportedPropertyException will be thrown if called for that transport
basicQuorum -
public WriteBucket notFoundOK(boolean notFoundOK)
UnsupportedPropertyException will be thrown if called for that transport
notFoundOK -
public WriteBucket withRetrier(Retrier retrier)
retrier - a Retrier to use for the execute operation
public WriteBucket enableForSearch()
UnsupportedPropertyException will be thrown if called for that transport
public WriteBucket disableSearch()
UnsupportedPropertyException will be thrown if called for that
transport
public WriteBucket lazyLoadBucketProperties()
execute() from fetching the BucketProperties from Riak
after storing any modifications made via this object.
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 | |||||||||