public interface RawClient
If you have the urge to write a client to Riak, please, please implement this interface so it can drop straight into all the higher level API code
| Modifier and Type | Method and Description |
|---|---|
void |
delete(String bucket,
String key)
Delete the data at
bucket/key |
void |
delete(String bucket,
String key,
DeleteMeta deleteMeta)
Delete the data at
bucket/key using the parameters in
deleteMeta |
void |
delete(String bucket,
String key,
int deleteQuorum)
Delete the data at
bucket/key using
deleteQuorum as the rw param |
RiakResponse |
fetch(String bucket,
String key)
Fetch data from
bucket/key |
RiakResponse |
fetch(String bucket,
String key,
FetchMeta fetchMeta)
Fetch data from the given
bucket/key with
fetchMeta |
RiakResponse |
fetch(String bucket,
String key,
int readQuorum)
Fetch data from the given
bukcet/key with read quorum
readQuorum |
BucketProperties |
fetchBucket(String bucketName)
The set of properties for the given bucket
|
List<String> |
fetchIndex(IndexQuery indexQuery)
Performs an 2i index query
|
byte[] |
generateAndSetClientId()
If you don't set a client id explicitly at least call this to set one.
|
byte[] |
getClientId()
Ask Riak for the client id for the current connection.
|
Transport |
getTransport()
The raw transport name.
|
RiakResponse |
head(String bucket,
String key,
FetchMeta fetchMeta)
Fetch only the meta-data from
bucket/key |
WalkResult |
linkWalk(LinkWalkSpec linkWalkSpec)
Performs a link walk operation described by the
LinkWalkSpec
provided. |
Set<String> |
listBuckets()
An Unmodifiable
Iterator view of the all the Buckets in Riak |
Iterable<String> |
listKeys(String bucketName)
An unmodifiable
Iterator view of the keys for the bucket named
bucketName
May be backed by a stream or a collection. |
MapReduceResult |
mapReduce(MapReduceSpec spec)
Perform a map/reduce query defined by
MapReduceSpec |
void |
ping()
Riak connection health check, is Riak reachable.
|
void |
setClientId(byte[] clientId)
Set a client id, currently must be a 4 bytes exactly
|
void |
shutdown() |
NodeStats |
stats()
Performs a Riak
/stats operation on the node(s) this client
is connected to. |
void |
store(IRiakObject object)
Store the given
IRiakObject in Riak using the bucket default w/dw
and false for returnBody |
RiakResponse |
store(IRiakObject object,
StoreMeta storeMeta)
Store the given
IRiakObject in Riak at the location
bucket/key |
void |
updateBucket(String name,
BucketProperties bucketProperties)
Update a buckets properties from the
BucketProperties provided. |
RiakResponse head(String bucket, String key, FetchMeta fetchMeta) throws IOException
bucket/keybucket - the bucketkey - the keyfetchMeta - the fetch optionsRiakResponse that, if it has an IRiakObject it
will have an empty valueIOExceptionRiakResponse fetch(String bucket, String key) throws IOException
bucket/keybucket - the bucketkey - the keyRiakResponseIOExceptionRiakResponse fetch(String bucket, String key, int readQuorum) throws IOException
bukcet/key with read quorum
readQuorumbucket - the bucketkey - the keyreadQuorum - readQuorum, needs to be =< the buckets n_valRiakResponseIOExceptionRiakResponse fetch(String bucket, String key, FetchMeta fetchMeta) throws IOException
bucket/key with
fetchMetabucket - the bucketkey - the keyfetchMeta - the extra fetch parameters FetchMetaRiakResponseIOExceptionRiakResponse store(IRiakObject object, StoreMeta storeMeta) throws IOException
IRiakObject in Riak at the location
bucket/keyobject - the data to storestoreMeta - meta data for the store operation as a StoreMetaRiakResponse if StoreMeta.getReturnBody() is
true, or nullIOExceptionvoid store(IRiakObject object) throws IOException
IRiakObject in Riak using the bucket default w/dw
and false for returnBodyobject - the data to store as an IRiakObjectIOExceptionvoid delete(String bucket, String key) throws IOException
bucket/keybucket - key - IOExceptionvoid delete(String bucket, String key, int deleteQuorum) throws IOException
bucket/key using
deleteQuorum as the rw parambucket - key - deleteQuorum - an int that is less than or equal to the bucket's n_valIOExceptionvoid delete(String bucket, String key, DeleteMeta deleteMeta) throws IOException
bucket/key using the parameters in
deleteMetabucket - key - deleteMeta - the DeleteMeta containing the operation parametersIOExceptionSet<String> listBuckets() throws IOException
Iterator view of the all the Buckets in RiakIOExceptionBucketProperties fetchBucket(String bucketName) throws IOException
bucketName - the name of the bucketBucketProperties (by populated, as populated
as the underlying API allows)IOExceptionvoid updateBucket(String name, BucketProperties bucketProperties) throws IOException
BucketProperties provided.
No guarantees that the underlying API is able to set all the properties
passed.name - the bucket to be updatedbucketProperties - the set of properties to be writenIOExceptionIterable<String> listKeys(String bucketName) throws IOException
Iterator view of the keys for the bucket named
bucketName
May be backed by a stream or a collection. Be careful, expensive.bucketName - IOExceptionWalkResult linkWalk(LinkWalkSpec linkWalkSpec) throws IOException
LinkWalkSpec
provided.
The underlying API may not support Link Walking directly but will
approximate it at some cost.linkWalkSpec - WalkResultIOExceptionMapReduceResult mapReduce(MapReduceSpec spec) throws IOException, MapReduceTimeoutException
MapReduceSpecspec - the m/r job specificationMapReduceResultIOExceptionMapReduceTimeoutExceptionbyte[] generateAndSetClientId()
throws IOException
IOExceptionvoid setClientId(byte[] clientId)
throws IOException
clientId - any 4 bytesIOExceptionbyte[] getClientId()
throws IOException
IOExceptionvoid ping()
throws IOException
IOException - if Riak is not reachable or returns anything other than OKList<String> fetchIndex(IndexQuery indexQuery) throws IOException
T - indexQuery - the query to performIOExceptionTransport getTransport()
Transport for the client or null if not implemented.void shutdown()
NodeStats stats() throws IOException
/stats operation on the node(s) this client
is connected to. The NodeStats object that is returned contains one
or more sets of stats and can be Iterated over.NodeStats object that represents one or more sets of stats.IOExceptionCopyright © 2012. All Rights Reserved.