com.basho.riak.pbc
Class RiakClient
java.lang.Object
com.basho.riak.pbc.RiakClient
public class RiakClient
- extends Object
Low level protocol buffers client.
Method Summary |
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)
|
BucketProperties |
getBucketProperties(com.google.protobuf.ByteString bucket)
|
String |
getClientID()
|
Map<String,String> |
getServerInfo()
|
com.google.protobuf.ByteString[] |
listBuckets()
|
KeySource |
listKeys(com.google.protobuf.ByteString bucket)
|
MapReduceResponseSource |
mapReduce(com.google.protobuf.ByteString request,
IRequestMeta meta)
|
MapReduceResponseSource |
mapReduce(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 |
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MSG_ErrorResp
public static final int MSG_ErrorResp
- See Also:
- Constant Field Values
MSG_PingReq
public static final int MSG_PingReq
- See Also:
- Constant Field Values
MSG_PingResp
public static final int MSG_PingResp
- See Also:
- Constant Field Values
MSG_GetClientIdReq
public static final int MSG_GetClientIdReq
- See Also:
- Constant Field Values
MSG_GetClientIdResp
public static final int MSG_GetClientIdResp
- See Also:
- Constant Field Values
MSG_SetClientIdReq
public static final int MSG_SetClientIdReq
- See Also:
- Constant Field Values
MSG_SetClientIdResp
public static final int MSG_SetClientIdResp
- See Also:
- Constant Field Values
MSG_GetServerInfoReq
public static final int MSG_GetServerInfoReq
- See Also:
- Constant Field Values
MSG_GetServerInfoResp
public static final int MSG_GetServerInfoResp
- See Also:
- Constant Field Values
MSG_GetReq
public static final int MSG_GetReq
- See Also:
- Constant Field Values
MSG_GetResp
public static final int MSG_GetResp
- See Also:
- Constant Field Values
MSG_PutReq
public static final int MSG_PutReq
- See Also:
- Constant Field Values
MSG_PutResp
public static final int MSG_PutResp
- See Also:
- Constant Field Values
MSG_DelReq
public static final int MSG_DelReq
- See Also:
- Constant Field Values
MSG_DelResp
public static final int MSG_DelResp
- See Also:
- Constant Field Values
MSG_ListBucketsReq
public static final int MSG_ListBucketsReq
- See Also:
- Constant Field Values
MSG_ListBucketsResp
public static final int MSG_ListBucketsResp
- See Also:
- Constant Field Values
MSG_ListKeysReq
public static final int MSG_ListKeysReq
- See Also:
- Constant Field Values
MSG_ListKeysResp
public static final int MSG_ListKeysResp
- See Also:
- Constant Field Values
MSG_GetBucketReq
public static final int MSG_GetBucketReq
- See Also:
- Constant Field Values
MSG_GetBucketResp
public static final int MSG_GetBucketResp
- See Also:
- Constant Field Values
MSG_SetBucketReq
public static final int MSG_SetBucketReq
- See Also:
- Constant Field Values
MSG_SetBucketResp
public static final int MSG_SetBucketResp
- See Also:
- Constant Field Values
MSG_MapRedReq
public static final int MSG_MapRedReq
- See Also:
- Constant Field Values
MSG_MapRedResp
public static final int MSG_MapRedResp
- See Also:
- Constant Field Values
RiakClient
public RiakClient(String host)
throws IOException
- Throws:
IOException
RiakClient
public RiakClient(String host,
int port)
throws IOException
- Throws:
IOException
RiakClient
public RiakClient(RiakConnectionPool pool)
RiakClient
public RiakClient(InetAddress addr,
int port)
throws IOException
- Throws:
IOException
RiakClient
public RiakClient(String host,
int port,
int bufferSizeKb)
throws IOException
- Throws:
IOException
prepareClientID
public void prepareClientID()
throws IOException
- helper method to use a reasonable default client id
beware, it caches the client id. If you call it multiple times on the same client
you get the *same* id (not good for reusing a client with different ids)
- Throws:
IOException
ping
public void ping()
throws IOException
- Throws:
IOException
setClientID
public void setClientID(String id)
throws IOException
- Warning: the riak client id is 4 bytes. This method silently truncates anymore bytes than that.
Be aware that if you have two client Ids, "boris1" and "boris2" this method will leave you with 1 client id, "bori".
Use
prepareClientID()
to generate a reasonably unique Id.
- Parameters:
id
-
- Throws:
IOException
- See Also:
prepareClientID()
setClientID
public void setClientID(com.google.protobuf.ByteString id)
throws IOException
- Throws:
IOException
getClientID
public String getClientID()
throws IOException
- Throws:
IOException
getServerInfo
public Map<String,String> getServerInfo()
throws IOException
- Throws:
IOException
fetch
public RiakObject[] fetch(String bucket,
String key,
int readQuorum)
throws IOException
- Throws:
IOException
fetch
public RiakObject[] fetch(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key,
int readQuorum)
throws IOException
- Throws:
IOException
fetch
public FetchResponse fetch(String bucket,
String key,
FetchMeta fetchMeta)
throws IOException
- Throws:
IOException
fetch
public FetchResponse fetch(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key,
FetchMeta fetchMeta)
throws IOException
- Throws:
IOException
fetch
public RiakObject[] fetch(String bucket,
String key)
throws IOException
- Throws:
IOException
fetch
public RiakObject[] fetch(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key)
throws IOException
- Throws:
IOException
store
public com.google.protobuf.ByteString[] store(RiakObject[] values,
RequestMeta meta)
throws IOException
- Throws:
IOException
store
public void store(RiakObject value)
throws IOException
- Throws:
IOException
store
public RiakObject[] store(RiakObject value,
IRequestMeta meta)
throws IOException
- Throws:
IOException
delete
public void delete(String bucket,
String key,
DeleteMeta deleteMeta)
throws IOException
- Throws:
IOException
delete
public void delete(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key,
DeleteMeta deleteMeta)
throws IOException
- Throws:
IOException
delete
public void delete(String bucket,
String key,
int rw)
throws IOException
- Throws:
IOException
delete
public void delete(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key,
int rw)
throws IOException
- Throws:
IOException
delete
public void delete(String bucket,
String key)
throws IOException
- Throws:
IOException
delete
public void delete(com.google.protobuf.ByteString bucket,
com.google.protobuf.ByteString key)
throws IOException
- Throws:
IOException
listBuckets
public com.google.protobuf.ByteString[] listBuckets()
throws IOException
- Throws:
IOException
getBucketProperties
public BucketProperties getBucketProperties(com.google.protobuf.ByteString bucket)
throws IOException
- Throws:
IOException
setBucketProperties
public void setBucketProperties(com.google.protobuf.ByteString bucket,
BucketProperties props)
throws IOException
- Throws:
IOException
listKeys
public KeySource listKeys(com.google.protobuf.ByteString bucket)
throws IOException
- Throws:
IOException
mapReduce
public MapReduceResponseSource mapReduce(JSONObject obj)
throws IOException
- Throws:
IOException
mapReduce
public MapReduceResponseSource mapReduce(String request,
IRequestMeta meta)
throws IOException
- Throws:
IOException
mapReduce
public MapReduceResponseSource mapReduce(com.google.protobuf.ByteString request,
IRequestMeta meta)
throws IOException
- Throws:
IOException
shutdown
public void shutdown()
Copyright © 2012. All Rights Reserved.