|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRiakClient
Primary high-level interface for accessing Riak.
Used to create/fetch/update Bucket
s and to
perform Map/Reduce query operations.
For example:
IRiakClient client = RiakFactory.pbcClient();
final byte[] id = client.generateAndSetClientId()
Bucket b = client.createBucket("myNewBucket")
.nVal(3)
.allowSiblings(true)
.execute();
// do things with the bucket
Bucket
,
MapReduce
Method Summary | |
---|---|
WriteBucket |
createBucket(String bucketName)
Create a new WriteBucket operation
to create a Bucket named for the passed String. |
FetchBucket |
fetchBucket(String bucketName)
Create a new FetchBucket operation, and return it. |
byte[] |
generateAndSetClientId()
Generate, set and return "random" byte[4] id for the client. |
byte[] |
getClientId()
Retrieve the client id from Riak that this client is using. |
Transport |
getTransport()
Optional method, the underlying transport. |
Set<String> |
listBuckets()
Set view of buckets in Riak |
BucketKeyMapReduce |
mapReduce()
Create MapReduce operation for a set of
bucket/key inputs. |
IndexMapReduce |
mapReduce(IndexQuery query)
Create a MapReduce operation that uses the supplied
IndexQuery as input |
BucketMapReduce |
mapReduce(String bucket)
Create MapReduce operation that has the supplied bucket as its input. |
SearchMapReduce |
mapReduce(String bucket,
String query)
Create a MapReduce operation that uses the supplied Riak Search
query as input. |
void |
ping()
Ping Riak, check it is available |
IRiakClient |
setClientId(byte[] clientId)
Set an ID for this client. |
void |
shutdown()
|
Iterable<NodeStats> |
stats()
Perform the Riak /stats operation on the node(s) this client
is connected to. |
WriteBucket |
updateBucket(Bucket bucket)
Create a new WriteBucket operation to update passed bucket. |
LinkWalk |
walk(IRiakObject startObject)
Create a LinkWalk operation that starts at startObject. |
Method Detail |
---|
IRiakClient setClientId(byte[] clientId) throws RiakException
clientId
- byte[4] that uniquely identify the client
RiakException
- if operation fails
IllegalArgumentException
- if clientId is null or not byte[4]byte[] generateAndSetClientId() throws RiakException
RiakException
ClientId
byte[] getClientId() throws RiakException
RiakException
Set<String> listBuckets() throws RiakException
RiakException
FetchBucket fetchBucket(String bucketName)
FetchBucket
operation, and return it.
bucketName
-
FetchBucket
configured to return the Bucket
called bucketName
for further configuration and execution.FetchBucket
WriteBucket updateBucket(Bucket bucket)
WriteBucket
operation to update passed bucket.
bucket
- the name of the Bucket
.
WriteBucket
configured to update the supplied bucket
for further configuration and execution.WriteBucket
WriteBucket createBucket(String bucketName)
WriteBucket
operation
to create a Bucket
named for the passed String.
bucketName
- the name of the new bucket.
WriteBucket
configured to create the new bucket
for further configuration and execution.WriteBucket
LinkWalk walk(IRiakObject startObject)
LinkWalk
operation that starts at startObject.
See also Link Walking on the basho site.
startObject
- the IRiakObject to start the Link walk from.
LinkWalk
operation for further configuration and execution.LinkWalk
BucketKeyMapReduce mapReduce()
MapReduce
operation for a set of
bucket/key inputs.
See also Map Reduce on the basho site.
BucketKeyMapReduce
for configuration and execution.MapReduce
,
BucketKeyMapReduce
BucketMapReduce mapReduce(String bucket)
MapReduce
operation that has the supplied bucket as its input.
bucket
- the String name of the input bucket to the M/R job.
BucketMapReduce
for further configuration and execution.MapReduce
,
BucketMapReduce
SearchMapReduce mapReduce(String bucket, String query)
MapReduce
operation that uses the supplied Riak Search
query as input.
See also
Riak Search on the basho wiki for more information.
bucket
- the input bucket for the search queryquery
- the input query for the search
SearchMapReduce
operation for further configuration and
execution.IndexMapReduce mapReduce(IndexQuery query)
MapReduce
operation that uses the supplied
IndexQuery
as input
Note: if you just want to fetch an index see
Bucket.fetchIndex(com.basho.riak.client.query.indexes.RiakIndex)
to create a FetchIndex
operation
query
- the IndexQuery
to use as input
MapReduce
operation for further configuration and
executionvoid ping() throws RiakException
RiakException
- if Riak does not respond OKTransport getTransport()
Transport
or null if not implemented.void shutdown()
Iterable<NodeStats> stats() throws RiakException
/stats
operation on the node(s) this client
is connected to.
This is not supported by the Riak Protobuf API
Iterable
object that contains one or more NodeStats
RiakException
- If Riak does not respond or if the protobuf API is being used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |