com.basho.riak.client.bucket
Class DefaultBucketProperties

java.lang.Object
  extended by com.basho.riak.client.bucket.DefaultBucketProperties
All Implemented Interfaces:
BucketProperties

public class DefaultBucketProperties
extends Object
implements BucketProperties

An immutable implementation of BucketProperties.

Use BucketPropertiesBuilder if you really have to make one, but your better to fetch one like with IRiakClient.fetchBucket(String) or create one with IRiakClient.createBucket(String)

Author:
russell
See Also:
IRiakClient, WriteBucket, FetchBucket

Constructor Summary
DefaultBucketProperties(Boolean allowSiblings, Boolean lastWriteWins, Integer nVal, String backend, VClockPruneProps vclockProps, Collection<NamedFunction> precommitHooks, Collection<NamedErlangFunction> postcommitHooks, TunableCAPProps capProps, NamedErlangFunction chashKeyFunction, NamedErlangFunction linkWalkFunction, Boolean search)
          Use the Builder BucketPropertiesBuilder instead of calling this constructor directly
 
Method Summary
 boolean equals(Object obj)
           
static BucketPropertiesBuilder from(DefaultBucketProperties properties)
          Create a BucketPropertiesBuilder populated from the given DefaultBucketProperties.
 BucketPropertiesBuilder fromMe()
          Create a BucketPropertiesBuilder populated with my values.
 Boolean getAllowSiblings()
          The allow_mult value for the bucket.
 String getBackend()
          The backend used by this bucket.
 Boolean getBasicQuorum()
          Should a read request return early in some failure cases? E.g.
 Integer getBigVClock()
          the big_vclock property for this bucket.
 NamedErlangFunction getChashKeyFunction()
          The chash_keyfun for this bucket.
 Quorum getDW()
          The default dw quorum for this bucket.
 Boolean getLastWriteWins()
          The last_write_wins value for the bucket.
 NamedErlangFunction getLinkWalkFunction()
          The linkwalk_fun for this bucket.
 Boolean getNotFoundOK()
          True if a vnode returning notfound for a key increments the r tally.
 Integer getNVal()
          This bucket's n_val.
 Long getOldVClock()
          the old_vclock property for this bucket.
 Collection<NamedErlangFunction> getPostcommitHooks()
          The set of postcommit hooks for this bucket.
 Quorum getPR()
          The default pr quorum for this bucket.
 Collection<NamedFunction> getPrecommitHooks()
          The set of precommit_hooks for this bucket.
 Quorum getPW()
          The default pw quorum for this bucket.
 Quorum getR()
          The default r quorum for this bucket.
 Quorum getRW()
          The default rw quorum for this bucket.
 Boolean getSearch()
          The search property
 Integer getSmallVClock()
          the small_vclock property for this bucket.
 Quorum getW()
          The default w quorum for this bucket.
 Long getYoungVClock()
          The young_vclcok property for this bucket.
 int hashCode()
           
 boolean isSearchEnabled()
          Is search enabled on this bucket
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultBucketProperties

public DefaultBucketProperties(Boolean allowSiblings,
                               Boolean lastWriteWins,
                               Integer nVal,
                               String backend,
                               VClockPruneProps vclockProps,
                               Collection<NamedFunction> precommitHooks,
                               Collection<NamedErlangFunction> postcommitHooks,
                               TunableCAPProps capProps,
                               NamedErlangFunction chashKeyFunction,
                               NamedErlangFunction linkWalkFunction,
                               Boolean search)
Use the Builder BucketPropertiesBuilder instead of calling this constructor directly

Parameters:
allowSiblings -
lastWriteWins -
nVal -
backend -
vclockProps -
precommitHooks -
postcommitHooks -
capProps -
chashKeyFunction -
linkWalkFunction -
search -
Method Detail

getAllowSiblings

public Boolean getAllowSiblings()
Description copied from interface: BucketProperties
The allow_mult value for the bucket.

Specified by:
getAllowSiblings in interface BucketProperties
Returns:
the allowSiblings if set, or null if not

getLastWriteWins

public Boolean getLastWriteWins()
Description copied from interface: BucketProperties
The last_write_wins value for the bucket.

Specified by:
getLastWriteWins in interface BucketProperties
Returns:
the lastWriteWins if set or null if not

getNVal

public Integer getNVal()
Description copied from interface: BucketProperties
This bucket's n_val.

Specified by:
getNVal in interface BucketProperties
Returns:
the nVal if set or null if not

getBackend

public String getBackend()
Description copied from interface: BucketProperties
The backend used by this bucket.

Specified by:
getBackend in interface BucketProperties
Returns:
the backend if set, or null.

getSmallVClock

public Integer getSmallVClock()
Description copied from interface: BucketProperties
the small_vclock property for this bucket. See controlling vector clock growth for details.

Specified by:
getSmallVClock in interface BucketProperties
Returns:
the small vector clock pruning property if set, or null.

getBigVClock

public Integer getBigVClock()
Description copied from interface: BucketProperties
the big_vclock property for this bucket. See controlling vector clock growth for details.

Specified by:
getBigVClock in interface BucketProperties
Returns:
the big vclock pruning size property if set, or null.

getYoungVClock

public Long getYoungVClock()
Description copied from interface: BucketProperties
The young_vclcok property for this bucket. See controlling vector clock growth for details.

Specified by:
getYoungVClock in interface BucketProperties
Returns:
the young vclock prune property if set, or null.

getOldVClock

public Long getOldVClock()
Description copied from interface: BucketProperties
the old_vclock property for this bucket. See controlling vector clock growth for details.

Specified by:
getOldVClock in interface BucketProperties
Returns:
the old vclock prune property if set, or null

getPrecommitHooks

public Collection<NamedFunction> getPrecommitHooks()
Description copied from interface: BucketProperties
The set of precommit_hooks for this bucket. See pre and post commit hooks for more details.

Specified by:
getPrecommitHooks in interface BucketProperties
Returns:
the precommit hooks, if any, or null

getPostcommitHooks

public Collection<NamedErlangFunction> getPostcommitHooks()
Description copied from interface: BucketProperties
The set of postcommit hooks for this bucket. See pre and post commit hooks for more details.

Specified by:
getPostcommitHooks in interface BucketProperties
Returns:
the post commit hooks, if any, or null

getR

public Quorum getR()
Description copied from interface: BucketProperties
The default r quorum for this bucket.

Specified by:
getR in interface BucketProperties
Returns:
the default CAP read quorum for this bucket, or null.

getW

public Quorum getW()
Description copied from interface: BucketProperties
The default w quorum for this bucket.

Specified by:
getW in interface BucketProperties
Returns:
the default CAP write quorum for this bucket, or null.

getRW

public Quorum getRW()
Description copied from interface: BucketProperties
The default rw quorum for this bucket.

Specified by:
getRW in interface BucketProperties
Returns:
the default CAP RW (delete) quorum for this bucket, or null.

getDW

public Quorum getDW()
Description copied from interface: BucketProperties
The default dw quorum for this bucket.

Specified by:
getDW in interface BucketProperties
Returns:
the default CAP durable write quorum for this bucket, or null.

getPR

public Quorum getPR()
Description copied from interface: BucketProperties
The default pr quorum for this bucket.

Specified by:
getPR in interface BucketProperties
Returns:
the default number of partitions in the primary preference list that must return from read request, for this bucket, or null.

getPW

public Quorum getPW()
Description copied from interface: BucketProperties
The default pw quorum for this bucket.

Specified by:
getPW in interface BucketProperties
Returns:
the default number of partitions in the primary preference list that must return from a write request, for this bucket, or null.

getBasicQuorum

public Boolean getBasicQuorum()
Description copied from interface: BucketProperties
Should a read request return early in some failure cases? E.g. If a quorum of nodes has already returned notfound/error, don't wait around for the rest.

Specified by:
getBasicQuorum in interface BucketProperties
Returns:
the default basic_quorum value for this bucket, or null.

getNotFoundOK

public Boolean getNotFoundOK()
Description copied from interface: BucketProperties
True if a vnode returning notfound for a key increments the r tally. False is higher consistency, true is higher availability.

Specified by:
getNotFoundOK in interface BucketProperties
Returns:
the default notfound_ok value for the bucket, or null.

getChashKeyFunction

public NamedErlangFunction getChashKeyFunction()
Description copied from interface: BucketProperties
The chash_keyfun for this bucket.

Specified by:
getChashKeyFunction in interface BucketProperties
Returns:
the key hashing function for the bucket, or null.

getLinkWalkFunction

public NamedErlangFunction getLinkWalkFunction()
Description copied from interface: BucketProperties
The linkwalk_fun for this bucket.

Specified by:
getLinkWalkFunction in interface BucketProperties
Returns:
the link walking function for the bucket, or null.

fromMe

public BucketPropertiesBuilder fromMe()
Create a BucketPropertiesBuilder populated with my values.

Returns:
a Builder populated from this BucketProperties' values.

from

public static BucketPropertiesBuilder from(DefaultBucketProperties properties)
Create a BucketPropertiesBuilder populated from the given DefaultBucketProperties.

Parameters:
properties -
Returns:
a Builder populated with properties values.

getSearch

public Boolean getSearch()
Description copied from interface: BucketProperties
The search property

Specified by:
getSearch in interface BucketProperties
Returns:
true/false/null

isSearchEnabled

public boolean isSearchEnabled()
Description copied from interface: BucketProperties
Is search enabled on this bucket

Specified by:
isSearchEnabled in interface BucketProperties
Returns:
true/false

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.