|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.basho.riak.client.raw.ClusterClient<T>
public abstract class ClusterClient<T extends Configuration>
A RawClient that can be configured with a cluster of Riak clients
that connect to different Riak nodes.
It uses a very basic modulus round robin algorithm to select the client to
use.
| Constructor Summary | |
|---|---|
ClusterClient(ClusterConfig<T> clusterConfig)
|
|
| Method Summary | |
|---|---|
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 |
protected abstract RawClient[] |
fromConfig(ClusterConfig<T> clusterConfig)
Create an array of clients for the cluster from the given ClusterConfig. |
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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.basho.riak.client.raw.RawClient |
|---|
getTransport |
| Constructor Detail |
|---|
public ClusterClient(ClusterConfig<T> clusterConfig)
throws IOException
IOException| Method Detail |
|---|
protected abstract RawClient[] fromConfig(ClusterConfig<T> clusterConfig)
throws IOException
ClusterConfig.
RawClient delegates that make up the cluster
IOException
public RiakResponse head(String bucket,
String key,
FetchMeta fetchMeta)
throws IOException
RawClientbucket/key
head in interface RawClientbucket - the bucketkey - the keyfetchMeta - the fetch options
RiakResponse that, if it has an IRiakObject it
will have an empty value
IOException
public RiakResponse fetch(String bucket,
String key)
throws IOException
RawClientbucket/key
fetch in interface RawClientbucket - the bucketkey - the key
RiakResponse
IOException
public RiakResponse fetch(String bucket,
String key,
int readQuorum)
throws IOException
RawClientbukcet/key with read quorum
readQuorum
fetch in interface RawClientbucket - the bucketkey - the keyreadQuorum - readQuorum, needs to be =< the buckets n_val
RiakResponse
IOException
public RiakResponse fetch(String bucket,
String key,
FetchMeta fetchMeta)
throws IOException
RawClientbucket/key with
fetchMeta
fetch in interface RawClientbucket - the bucketkey - the keyfetchMeta - the extra fetch parameters FetchMeta
RiakResponse
IOException
public RiakResponse store(IRiakObject object,
StoreMeta storeMeta)
throws IOException
RawClientIRiakObject in Riak at the location
bucket/key
store in interface RawClientobject - the data to storestoreMeta - meta data for the store operation as a StoreMeta
RiakResponse if StoreMeta.getReturnBody() is
true, or null
IOException
public void store(IRiakObject object)
throws IOException
RawClientIRiakObject in Riak using the bucket default w/dw
and false for returnBody
store in interface RawClientobject - the data to store as an IRiakObject
IOException
public void delete(String bucket,
String key)
throws IOException
RawClientbucket/key
delete in interface RawClientIOException
public void delete(String bucket,
String key,
int deleteQuorum)
throws IOException
RawClientbucket/key using
deleteQuorum as the rw param
delete in interface RawClientdeleteQuorum - an int that is less than or equal to the bucket's n_val
IOException
public void delete(String bucket,
String key,
DeleteMeta deleteMeta)
throws IOException
RawClientbucket/key using the parameters in
deleteMeta
delete in interface RawClientdeleteMeta - the DeleteMeta containing the operation parameters
IOException
public Set<String> listBuckets()
throws IOException
RawClientIterator view of the all the Buckets in Riak
listBuckets in interface RawClientIOException
public BucketProperties fetchBucket(String bucketName)
throws IOException
RawClient
fetchBucket in interface RawClientbucketName - the name of the bucket
BucketProperties (by populated, as populated
as the underlying API allows)
IOException
public void updateBucket(String name,
BucketProperties bucketProperties)
throws IOException
RawClientBucketProperties provided.
No guarantees that the underlying API is able to set all the properties
passed.
updateBucket in interface RawClientname - the bucket to be updatedbucketProperties - the set of properties to be writen
IOException
public Iterable<String> listKeys(String bucketName)
throws IOException
RawClientIterator view of the keys for the bucket named
bucketName
May be backed by a stream or a collection. Be careful, expensive.
listKeys in interface RawClientIOException
public WalkResult linkWalk(LinkWalkSpec linkWalkSpec)
throws IOException
RawClientLinkWalkSpec
provided.
The underlying API may not support Link Walking directly but will
approximate it at some cost.
linkWalk in interface RawClientWalkResult
IOException
public MapReduceResult mapReduce(MapReduceSpec spec)
throws IOException,
MapReduceTimeoutException
RawClientMapReduceSpec
mapReduce in interface RawClientspec - the m/r job specification
MapReduceResult
IOException
MapReduceTimeoutException
public byte[] generateAndSetClientId()
throws IOException
RawClient
generateAndSetClientId in interface RawClientIOException
public void setClientId(byte[] clientId)
throws IOException
RawClient
setClientId in interface RawClientclientId - any 4 bytes
IOException
public byte[] getClientId()
throws IOException
RawClient
getClientId in interface RawClientIOException
public void ping()
throws IOException
RawClient
ping in interface RawClientIOException - if Riak is not reachable or returns anything other than OK
public List<String> fetchIndex(IndexQuery indexQuery)
throws IOException
RawClient
fetchIndex in interface RawClientindexQuery - the query to perform
IOExceptionpublic void shutdown()
shutdown in interface RawClient
public NodeStats stats()
throws IOException
RawClient/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.
stats in interface RawClientNodeStats object that represents one or more sets of stats.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||