public interface Bucket extends BucketProperties
RiakOperation
s.
Provides convenience methods for creating RiakOperation
s for storing
byte[]
and String
data in Riak. Also provides
methods for creating RiakOperation
s for storing Java Bean style POJOs
in Riak. A Bucket is a factory for RiakOperation
s on Key/Value
data.
Gives access to all the BucketProperties
that the underlying API
transport exposes. NOTE: soon this will be *all* the BucketProperties
Provides access to an Iterable
for the keys in the bucket.
StoreObject
,
FetchObject
,
DeleteObject
Modifier and Type | Method and Description |
---|---|
CounterObject |
counter(String counter)
Creates a
CounterObject operation |
DeleteObject |
delete(String key)
|
<T> DeleteObject |
delete(T o)
Creates a
DeleteObject operation that will delete the data at
o 's RiakKey annotated field value on
execute() . |
FetchObject<IRiakObject> |
fetch(String key)
|
<T> FetchObject<T> |
fetch(String key,
Class<T> type)
|
<T> FetchObject<T> |
fetch(T o)
Creates a
FetchObject operation that returns the data at
o 's annotated RiakKey field as an instance of type
T on execute() . |
<T> FetchIndex<T> |
fetchIndex(RiakIndex<T> index)
Creates a
FetchIndex operation for the given index name and type |
String |
getName()
Get this Buckets name.
|
StreamingOperation<String> |
keys()
An
Iterable view of the keys stored in this bucket. |
<T> MultiFetchObject<T> |
multiFetch(List<String> keys,
Class<T> type)
Creates a
MultiFetchObject operation that returns the datum at
keys as a list of type T futures on
execute() . |
<T> MultiFetchObject<T> |
multiFetch(List<T> o)
Creates a
MultiFetchObject operation that returns the data at
o 's annotated RiakKey field as a list of type
T futures on execute() . |
MultiFetchObject<IRiakObject> |
multiFetch(String[] keys)
Creates a
MultiFetchObject that returns the datum at keys
as a list of IRiakObject futures on execute() . |
StoreObject<IRiakObject> |
store(String key,
byte[] value)
Creates a
StoreObject that will store a new IRiakObject . |
StoreObject<IRiakObject> |
store(String key,
String value)
Creates a
StoreObject that will store a new IRiakObject . |
<T> StoreObject<T> |
store(String key,
T o)
|
<T> StoreObject<T> |
store(T o)
|
getAllowSiblings, getBackend, getBasicQuorum, getBigVClock, getChashKeyFunction, getDW, getLastWriteWins, getLinkWalkFunction, getNotFoundOK, getNVal, getOldVClock, getPostcommitHooks, getPR, getPrecommitHooks, getPW, getR, getRW, getSearch, getSmallVClock, getW, getYoungVClock, isSearchEnabled
String getName()
StoreObject<IRiakObject> store(String key, byte[] value)
StoreObject
that will store a new IRiakObject
.key
- the key to store the data under.value
- the data as a byte[]StoreObject
StoreObject
StoreObject<IRiakObject> store(String key, String value)
StoreObject
that will store a new IRiakObject
.key
- the key to store the data under.value
- the data as a stringStoreObject
StoreObject
<T> StoreObject<T> store(T o)
StoreObject
for storing o
of type
T
on execute()
. T
must have
a field annotated with RiakKey
.T
- the Type of o
o
- the data to storeStoreObject
StoreObject
<T> StoreObject<T> store(String key, T o)
T
- the Type of o
o
- the data to storekey
- the keyStoreObject
StoreObject
FetchObject<IRiakObject> fetch(String key)
key
- the keyFetchObject
FetchObject
<T> FetchObject<T> fetch(String key, Class<T> type)
T
- the Type to returnkey
- the key under which the data is storedtype
- the Class of the type to returnFetchObject
FetchObject
<T> FetchObject<T> fetch(T o)
FetchObject
operation that returns the data at
o
's annotated RiakKey
field as an instance of type
T
on execute()
.T
- the Type to returno
- an instance ot T
that has the key annotated with
RiakKey
FetchObject
FetchObject
MultiFetchObject<IRiakObject> multiFetch(String[] keys)
MultiFetchObject
that returns the datum at keys
as a list of IRiakObject
futures on execute()
.keys
- the keysMultiFetchObject
MultiFetchObject
<T> MultiFetchObject<T> multiFetch(List<String> keys, Class<T> type)
MultiFetchObject
operation that returns the datum at
keys
as a list of type T
futures on
execute()
.T
- the Type to returnkeys
- the list of keys under which the data is storedtype
- the Class of the type to returnMultiFetchObject
MultiFetchObject
<T> MultiFetchObject<T> multiFetch(List<T> o)
MultiFetchObject
operation that returns the data at
o
's annotated RiakKey
field as a list of type
T
futures on execute()
.T
- the Type to returno
- a List of T
that has the keys annotated with
RiakKey
MultiFetchObject
MultiFetchObject
CounterObject counter(String counter)
CounterObject
operationcounter
- the name (key) for the counterCounterObject
<T> DeleteObject delete(T o)
DeleteObject
operation that will delete the data at
o
's RiakKey
annotated field value on
execute()
.T
- the Type of o
o
- an instance of T
with a value for the key in the
field annotated by RiakKey
DeleteObject
DeleteObject
DeleteObject delete(String key)
T
- the Type of o
o
- an instance of T
with a value for the key in the
field annotated by RiakKey
DeleteObject
DeleteObject
StreamingOperation<String> keys() throws RiakException
Iterable
view of the keys stored in this bucket.Iterable
of Strings.RiakException
<T> FetchIndex<T> fetchIndex(RiakIndex<T> index)
FetchIndex
operation for the given index name and typeT
- the index type (currently String or Long)index
- an indexFetchIndex
operation for further configuration and
executionCopyright © 2013. All Rights Reserved.