public class FastDHTClient extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected ServerGroup |
serverGroup |
protected byte |
status |
| 构造器和说明 |
|---|
FastDHTClient(boolean bMultiThread) |
FastDHTClient(ServerGroup serverGroup) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
batchDelete(ObjectInfo objInfo,
String[] keys,
Map failKeys)
delete multi keys
|
Hashtable |
batchGet(ObjectInfo objInfo,
String[] keys,
Map failKeys)
get multi keys
|
Hashtable |
batchGet(ObjectInfo objInfo,
String[] keys,
Map failKeys,
int expires)
get multi keys
|
int |
batchSet(ObjectInfo objInfo,
Map keyValues,
Map failKeys)
set values of multi keys
|
int |
batchSet(ObjectInfo objInfo,
Map keyValues,
Map failKeys,
int expires)
set values of multi keys
|
void |
close() |
int |
delete(KeyInfo keyInfo)
delete key
|
String |
get(KeyInfo keyInfo)
retrieve value of key
|
String |
get(KeyInfo keyInfo,
int expires)
retrieve value of key
|
byte[] |
getBytes(KeyInfo keyInfo)
retrieve value of key
|
byte[] |
getBytes(KeyInfo keyInfo,
int expires)
retrieve value of key
|
byte |
getErrorCode() |
String[] |
getSubKeys(ObjectInfo objInfo)
get object's sub keys
|
Long |
inc(KeyInfo keyInfo,
int increment) |
Long |
inc(KeyInfo keyInfo,
int increment,
int expires)
retrieve value of key
|
int |
set(KeyInfo keyInfo,
byte[] value)
set value of key
|
int |
set(KeyInfo keyInfo,
byte[] value,
int expires)
set value of key
|
int |
set(KeyInfo keyInfo,
String value)
set value of key
|
int |
set(KeyInfo keyInfo,
String value,
int expires)
set value of key
|
Hashtable |
stat(int server_index)
get stat hashtable
|
protected ServerGroup serverGroup
protected byte status
public FastDHTClient(ServerGroup serverGroup)
serverGroup - group infopublic FastDHTClient(boolean bMultiThread)
bMultiThread - if use in multi-threadpublic void close()
public byte getErrorCode()
public int set(KeyInfo keyInfo, String value) throws UnsupportedEncodingException, MyException
keyInfo - the key to setvalue - value of the keyUnsupportedEncodingExceptionMyExceptionpublic int set(KeyInfo keyInfo, byte[] value) throws UnsupportedEncodingException, MyException
keyInfo - the key to setvalue - value of the keyUnsupportedEncodingExceptionMyExceptionpublic int set(KeyInfo keyInfo, String value, int expires) throws UnsupportedEncodingException, MyException
keyInfo - the key to setvalue - value of the keyexpires - expire timestamp, ProtoCommon.FDHT_EXPIRES_NEVER for never expiredUnsupportedEncodingExceptionMyExceptionpublic int set(KeyInfo keyInfo, byte[] value, int expires) throws UnsupportedEncodingException, MyException
keyInfo - the key to setvalue - value of the keyexpires - expire timestamp, ProtoCommon.FDHT_EXPIRES_NEVER for never expiredUnsupportedEncodingExceptionMyExceptionpublic int delete(KeyInfo keyInfo) throws MyException
keyInfo - the key to deleteMyExceptionpublic String get(KeyInfo keyInfo) throws UnsupportedEncodingException, MyException
keyInfo - the key to getUnsupportedEncodingExceptionMyExceptionpublic String get(KeyInfo keyInfo, int expires) throws UnsupportedEncodingException, MyException
keyInfo - the key to getexpires - expire timestamp, ProtoCommon.FDHT_EXPIRES_NONE for not change the expired timeUnsupportedEncodingExceptionMyExceptionpublic byte[] getBytes(KeyInfo keyInfo) throws UnsupportedEncodingException, MyException
keyInfo - the key to getUnsupportedEncodingExceptionMyExceptionpublic byte[] getBytes(KeyInfo keyInfo, int expires) throws MyException
keyInfo - the key to getexpires - expire timestamp, ProtoCommon.FDHT_EXPIRES_NONE for not change the expired timeMyExceptionpublic Long inc(KeyInfo keyInfo, int increment) throws MyException
MyExceptionpublic Long inc(KeyInfo keyInfo, int increment, int expires) throws MyException
keyInfo - the key to getincrement - increment valueexpires - expire timestamp, ProtoCommon.FDHT_EXPIRES_NEVER for never expiredMyExceptionpublic int batchSet(ObjectInfo objInfo, Map keyValues, Map failKeys) throws MyException
objInfo - object info, including namespace and object idkeyValues - key value pair, key and value's type is StringfailKeys - fail key, key 's type is String and value's type is IntegerMyException - if an error occurredpublic int batchSet(ObjectInfo objInfo, Map keyValues, Map failKeys, int expires) throws MyException
objInfo - object info, including namespace and object idkeyValues - key value pair, key and value's type is StringfailKeys - fail key, key 's type is String and value's type is Integerexpires - expire timestamp, ProtoCommon.FDHT_EXPIRES_NEVER for never expiredMyException - if an error occurredpublic int batchDelete(ObjectInfo objInfo, String[] keys, Map failKeys) throws MyException
objInfo - object info, including namespace and object idkeys - key arrayfailKeys - fail key, key 's type is String and value's type is IntegerMyException - if an error occurredpublic Hashtable batchGet(ObjectInfo objInfo, String[] keys, Map failKeys) throws MyException
objInfo - object info, including namespace and object idkeys - key arrayfailKeys - fail key, key 's type is String and value's type is IntegerMyException - if an error occurredpublic Hashtable batchGet(ObjectInfo objInfo, String[] keys, Map failKeys, int expires) throws MyException
objInfo - object info, including namespace and object idkeys - key arrayfailKeys - fail key, key 's type is String and value's type is Integerexpires - expire timestamp, ProtoCommon.FDHT_EXPIRES_NONE for not change the expired timeMyException - if an error occurredpublic Hashtable stat(int server_index) throws MyException
server_index - the server indexMyException - if an error occurredpublic String[] getSubKeys(ObjectInfo objInfo) throws UnsupportedEncodingException, MyException
objInfo - object info, including namespace and object idUnsupportedEncodingException - if an error occurredMyException - if an error occurredCopyright © 2017. All rights reserved.