public class RiakClient extends Object
Constructor and Description |
---|
RiakClient(InetAddress addr,
int port) |
RiakClient(RiakConnectionPool pool) |
RiakClient(String host) |
RiakClient(String host,
int port) |
RiakClient(String host,
int port,
int bufferSizeKb) |
Modifier and Type | Method and Description |
---|---|
void |
delete(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key) |
void |
delete(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key,
DeleteMeta deleteMeta) |
void |
delete(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key,
int rw) |
void |
delete(String bucket,
String key) |
void |
delete(String bucket,
String key,
DeleteMeta deleteMeta) |
void |
delete(String bucket,
String key,
int rw) |
RiakObject[] |
fetch(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key) |
FetchResponse |
fetch(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key,
FetchMeta fetchMeta) |
RiakObject[] |
fetch(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key,
int readQuorum) |
RiakObject[] |
fetch(String bucket,
String key) |
FetchResponse |
fetch(String bucket,
String key,
FetchMeta fetchMeta) |
RiakObject[] |
fetch(String bucket,
String key,
int readQuorum) |
Long |
fetchCounter(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString counter,
FetchMeta meta) |
Long |
fetchCounter(String bucket,
String counter,
FetchMeta meta) |
BucketProperties |
getBucketProperties(com.google.protobuf.ByteString bucket) |
String |
getClientID() |
Map<String,String> |
getServerInfo() |
Long |
incrementCounter(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString counter,
long increment,
RequestMeta meta) |
Long |
incrementCounter(String bucket,
String counter,
long increment,
RequestMeta meta) |
IndexSource |
index(IndexRequest request)
Streaming secondary index query.
|
List<String> |
index(String bucket,
String indexName,
long value) |
List<String> |
index(String bucket,
String indexName,
long start,
long end) |
List<String> |
index(String bucket,
String indexName,
String value) |
List<String> |
index(String bucket,
String indexName,
String start,
String end) |
com.google.protobuf.ByteString[] |
listBuckets() |
BucketSource |
listBucketsStreaming() |
KeySource |
listKeys(com.google.protobuf.ByteString bucket) |
MapReduceResponseSource |
mapReduce(com.google.protobuf.ByteString request,
IRequestMeta meta) |
MapReduceResponseSource |
mapReduce(org.json.JSONObject obj) |
MapReduceResponseSource |
mapReduce(String request,
IRequestMeta meta) |
void |
ping() |
void |
prepareClientID()
helper method to use a reasonable default client id
beware, it caches the client id.
|
void |
resetBucketProperties(com.google.protobuf.ByteString bucket) |
void |
setBucketProperties(com.google.protobuf.ByteString bucket,
BucketProperties props) |
void |
setClientID(com.google.protobuf.ByteString id) |
void |
setClientID(String id)
Warning: the riak client id is 4 bytes.
|
void |
shutdown() |
void |
store(RiakObject value) |
com.google.protobuf.ByteString[] |
store(RiakObject[] values,
RequestMeta meta) |
RiakObject[] |
store(RiakObject value,
IRequestMeta meta) |
public static final int MSG_ErrorResp
public static final int MSG_PingReq
public static final int MSG_PingResp
public static final int MSG_GetClientIdReq
public static final int MSG_GetClientIdResp
public static final int MSG_SetClientIdReq
public static final int MSG_SetClientIdResp
public static final int MSG_GetServerInfoReq
public static final int MSG_GetServerInfoResp
public static final int MSG_GetReq
public static final int MSG_GetResp
public static final int MSG_PutReq
public static final int MSG_PutResp
public static final int MSG_DelReq
public static final int MSG_DelResp
public static final int MSG_ListBucketsReq
public static final int MSG_ListBucketsResp
public static final int MSG_ListKeysReq
public static final int MSG_ListKeysResp
public static final int MSG_GetBucketReq
public static final int MSG_GetBucketResp
public static final int MSG_SetBucketReq
public static final int MSG_SetBucketResp
public static final int MSG_MapRedReq
public static final int MSG_MapRedResp
public static final int MSG_IndexReq
public static final int MSG_IndexResp
public static final int MSG_SearchQueryReq
public static final int MSG_SearchQueryResp
public static final int MSG_ResetBucketReq
public static final int MSG_ResetBucketResp
public static final int MSG_CounterUpdateReq
public static final int MSG_CounterUpdateResp
public static final int MSG_CounterGetReq
public static final int MSG_CounterGetResp
public RiakClient(String host) throws IOException
IOException
public RiakClient(String host, int port) throws IOException
IOException
public RiakClient(RiakConnectionPool pool)
public RiakClient(InetAddress addr, int port) throws IOException
IOException
public RiakClient(String host, int port, int bufferSizeKb) throws IOException
IOException
public void prepareClientID() throws IOException
IOException
public void ping() throws IOException
IOException
public void setClientID(String id) throws IOException
prepareClientID()
to generate a reasonably unique Id.id
- IOException
prepareClientID()
public void setClientID(com.google.protobuf.ByteString id) throws IOException
IOException
public String getClientID() throws IOException
IOException
public Map<String,String> getServerInfo() throws IOException
IOException
public RiakObject[] fetch(String bucket, String key, int readQuorum) throws IOException
IOException
public RiakObject[] fetch(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key, int readQuorum) throws IOException
IOException
public FetchResponse fetch(String bucket, String key, FetchMeta fetchMeta) throws IOException
IOException
public FetchResponse fetch(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key, FetchMeta fetchMeta) throws IOException
IOException
public RiakObject[] fetch(String bucket, String key) throws IOException
IOException
public RiakObject[] fetch(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key) throws IOException
IOException
public List<String> index(String bucket, String indexName, String value) throws IOException
bucket
- the bucket nameindexName
- the name of the index (e.g. 'user_bin')value
- the index valueIOException
public List<String> index(String bucket, String indexName, String start, String end) throws IOException
bucket
- the bucket nameindexName
- the name of the index (e.g. 'user_bin')start
- the start value in a range (e.g 'a')end
- the end value in a range (e.g. 'z')IOException
public List<String> index(String bucket, String indexName, long value) throws IOException
bucket
- the bucket nameindexName
- the index (e.g. 'age_int')value
- a long for the index valueIOException
public List<String> index(String bucket, String indexName, long start, long end) throws IOException
bucket
- the bucket nameindexName
- the index (e.g. 'age_int')start
- the start value in a range (e.g 16)end
- the end value in a range (e.g. 32)IOException
public IndexSource index(IndexRequest request) throws IOException
RiakStreamClient.close()
if you do not
iterate through the entire result set.request
- a IndexRequest
containing the query parametersIndexSource
IOException
public Long incrementCounter(String bucket, String counter, long increment, RequestMeta meta) throws IOException
IOException
public Long incrementCounter(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString counter, long increment, RequestMeta meta) throws IOException
IOException
public Long fetchCounter(String bucket, String counter, FetchMeta meta) throws IOException
IOException
public Long fetchCounter(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString counter, FetchMeta meta) throws IOException
IOException
public com.google.protobuf.ByteString[] store(RiakObject[] values, RequestMeta meta) throws IOException
IOException
public void store(RiakObject value) throws IOException
IOException
public RiakObject[] store(RiakObject value, IRequestMeta meta) throws IOException
IOException
public void delete(String bucket, String key, DeleteMeta deleteMeta) throws IOException
IOException
public void delete(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key, DeleteMeta deleteMeta) throws IOException
IOException
public void delete(String bucket, String key, int rw) throws IOException
IOException
public void delete(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key, int rw) throws IOException
IOException
public void delete(String bucket, String key) throws IOException
IOException
public void delete(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key) throws IOException
IOException
public com.google.protobuf.ByteString[] listBuckets() throws IOException
IOException
public BucketSource listBucketsStreaming() throws IOException
IOException
public BucketProperties getBucketProperties(com.google.protobuf.ByteString bucket) throws IOException
IOException
public void setBucketProperties(com.google.protobuf.ByteString bucket, BucketProperties props) throws IOException
IOException
public void resetBucketProperties(com.google.protobuf.ByteString bucket) throws IOException
IOException
public KeySource listKeys(com.google.protobuf.ByteString bucket) throws IOException
IOException
public MapReduceResponseSource mapReduce(org.json.JSONObject obj) throws IOException
IOException
public MapReduceResponseSource mapReduce(String request, IRequestMeta meta) throws IOException
IOException
public MapReduceResponseSource mapReduce(com.google.protobuf.ByteString request, IRequestMeta meta) throws IOException
IOException
public void shutdown()
Copyright © 2014. All Rights Reserved.