com.basho.riak.client.raw
Class FetchMeta

java.lang.Object
  extended by com.basho.riak.client.raw.FetchMeta

public class FetchMeta
extends Object

Encapsulates the set of parameters available when fetching data from Riak

Author:
russell

Nested Class Summary
static class FetchMeta.Builder
           
 
Constructor Summary
FetchMeta(Integer r, Integer pr, Boolean notFoundOK, Boolean basicQuorum, Boolean headOnly, Boolean returnDeletedVClock, Date ifModifiedSince, VClock ifModifiedVClock)
          Create a fetch meta with the specified parameters for a conditional fetch with the either API
FetchMeta(Quorum r, Quorum pr, Boolean notFoundOK, Boolean basicQuorum, Boolean headOnly, Boolean returnDeletedVClock, Date ifModifiedSince, VClock ifModifiedVClock)
          Create a fetch meta with the specified parameters for a conditional fetch with the either API
 
Method Summary
 Boolean getBasicQuorum()
           
 Boolean getHeadOnly()
           
 Date getIfModifiedSince()
          The date for an HTTP fetch if-modified-since.
 VClock getIfModifiedVClock()
          The VClock to use in a conditional fetch with the PB API.
 Boolean getNotFoundOK()
           
 Quorum getPr()
           
 Quorum getR()
           
 Boolean getReturnDeletedVClock()
           
 boolean hasBasicQuorum()
           
 boolean hasHeadOnly()
           
 boolean hasNotFoundOk()
           
 boolean hasPr()
           
 boolean hasR()
           
 boolean hasReturnDeletedVClock()
           
static FetchMeta head()
           
static FetchMeta withR(int readQuorum)
          Convenient way to create a fetch meta with just an r value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FetchMeta

public FetchMeta(Integer r,
                 Integer pr,
                 Boolean notFoundOK,
                 Boolean basicQuorum,
                 Boolean headOnly,
                 Boolean returnDeletedVClock,
                 Date ifModifiedSince,
                 VClock ifModifiedVClock)
Create a fetch meta with the specified parameters for a conditional fetch with the either API

Parameters:
r - how many vnodes must reply
pr - how many primary vnodes must reply, takes precedence over r
notFoundOK - if a notfound response counts towards satisfying the r value
basicQuorum - if after a quorum of notfounds/error return at once
headOnly - only return the object meta, not its value
returnDeletedVClock - if an object has been deleted, return the tombstone vclock
ifModifiedSince - a date for conditional get. Not null value means only return a value if the last_modified date is later than this date *NOTE* only for HTTP API!!!
ifModifiedVClock - a vclock for conditional get. Not null value means only return a value if the current vclock does not match this one. *NOTE* Only for PB API!

FetchMeta

public FetchMeta(Quorum r,
                 Quorum pr,
                 Boolean notFoundOK,
                 Boolean basicQuorum,
                 Boolean headOnly,
                 Boolean returnDeletedVClock,
                 Date ifModifiedSince,
                 VClock ifModifiedVClock)
Create a fetch meta with the specified parameters for a conditional fetch with the either API

Parameters:
r - how many vnodes must reply
pr - how many primary vnodes must reply, takes precedence over r
notFoundOK - if a notfound response counts towards satisfying the r value
basicQuorum - if after a quorum of notfounds/error return at once
headOnly - only return the object meta, not its value
returnDeletedVClock - if an object has been deleted, return the tombstone vclock
ifModifiedSince - a date for conditional get. Not null value means only return a value if the last_modified date is later than this date *NOTE* only for HTTP API!!!
ifModifiedVClock - a vclock for conditional get. Not null value means only return a value if the current vclock does not match this one. *NOTE* Only for PB API!
Method Detail

hasR

public boolean hasR()
Returns:
true if the r parameter is set, false otherwise

getR

public Quorum getR()
Returns:
the r

hasPr

public boolean hasPr()
Returns:
true if the pr parameter is set, false otherwise

getPr

public Quorum getPr()
Returns:
the pr

hasNotFoundOk

public boolean hasNotFoundOk()
Returns:
true if the notFoundOk parameter is set, false otherwise

getNotFoundOK

public Boolean getNotFoundOK()
Returns:
the notFoundOK

hasBasicQuorum

public boolean hasBasicQuorum()
Returns:
true if the basicQuorum parameter is set, false otherwise

getBasicQuorum

public Boolean getBasicQuorum()
Returns:
the basicQuorum

hasHeadOnly

public boolean hasHeadOnly()
Returns:
true if the headOnly parameter is set, false otherwise

getHeadOnly

public Boolean getHeadOnly()
Returns:
the headOnly

hasReturnDeletedVClock

public boolean hasReturnDeletedVClock()
Returns:
true if the returnDeletedVClock parameter is set, false otherwise

getReturnDeletedVClock

public Boolean getReturnDeletedVClock()
Returns:
the returnDeletedVClock

getIfModifiedVClock

public VClock getIfModifiedVClock()
The VClock to use in a conditional fetch with the PB API.

Returns:
the VClock value, null means this fetch is not conditional.

getIfModifiedSince

public Date getIfModifiedSince()
The date for an HTTP fetch if-modified-since.

Returns:
the Date value, null means this fetch is not conditional.

withR

public static FetchMeta withR(int readQuorum)
Convenient way to create a fetch meta with just an r value

Parameters:
readQuorum -
Returns:
a FetchMeta with just an R value

head

public static FetchMeta head()
Returns:
a FetchMeta empty for everything except headOnly


Copyright © 2012. All Rights Reserved.