public class ClusterClient extends Object implements ScanPersistence
Modifier and Type | Class and Description |
---|---|
class |
ClusterClient.ClusterCursor |
class |
ClusterClient.KeyCluster |
class |
ClusterClient.RunThread |
Modifier and Type | Field and Description |
---|---|
protected ClientConnections |
clientConnections |
protected TCPClientFactory.ClientType |
clientType |
protected Serializer |
embeddedSerializer |
protected boolean |
nio |
protected Serializer |
serializer |
protected String |
store |
protected long |
timeout |
Constructor and Description |
---|
ClusterClient(List<ClusterNodes> clusterNodesList,
String store,
Serializer serializer,
TCPClientFactory.ClientType clientType) |
Modifier and Type | Method and Description |
---|---|
void |
backup(String path,
int rate) |
void |
close() |
List<Object> |
clusterStoreProc(Invoker invoker,
List<voldemort.store.cachestore.Key> keys) |
List<Object> |
clusterStoreProc(Invoker invoker,
List<voldemort.store.cachestore.Key> keys,
String queryStr) |
Future |
clusterStoreProcFuture(Invoker invoker,
List<voldemort.store.cachestore.Key> keys) |
protected Request |
create4GetPutRequest(List list,
OpType opType,
String queryStr) |
protected Request |
createCursorRequest(CursorPara cursorPara) |
protected Request |
createScanRequest(ScanParaList scanParaList) |
protected Request |
createStoreProcRequest(Invoker invoker) |
protected List<Object> |
executeStoreProc(Invoker invoker,
List<ClusterClient.KeyCluster> keyClusterList,
boolean addKey) |
protected List<Object> |
executeStoreProc(Invoker invoker,
List<ClusterClient.KeyCluster> keyClusterList,
boolean addKey,
String queryStr) |
protected List<ClusterClient.KeyCluster> |
findAll() |
protected void |
findKeyCluster(voldemort.store.cachestore.Key key,
List<ClusterClient.KeyCluster> list) |
protected List<ClusterClient.KeyCluster> |
findKeyGroups(List<voldemort.store.cachestore.Key> list) |
protected List<voldemort.store.cachestore.voldeimpl.KeyValue> |
findList(List<voldemort.store.cachestore.Key> keys,
List<voldemort.store.cachestore.voldeimpl.KeyValue> keyValues) |
voldemort.store.cachestore.Value |
get(voldemort.store.cachestore.Key key) |
Iterator |
getKeyIterator() |
protected List<voldemort.store.cachestore.Key> |
getKeyList(List<voldemort.store.cachestore.voldeimpl.KeyValue> list) |
String |
getStore() |
void |
insert(voldemort.store.cachestore.Key key,
voldemort.store.cachestore.Value value) |
List<Object> |
invoke(Invoker invoker)
invoke store proc across clusters without passing keyList
one node per cluster
|
List<Object> |
invokeMapReduce(Invoker invoker)
invoke MapReduce store proc across the cluster, The goal is to use max number of node
so it try to invoke every node in each cluster, instead of one node per cluster
data node will be provided partition information through additional parameter add to invoker
in the format of (node#, total nodes)
|
ClusterClient.ClusterCursor |
mergeCluster(List<Runnable> runnableList,
ClusterClient.ClusterCursor clusterCursor) |
protected List<voldemort.store.cachestore.voldeimpl.KeyValue> |
mergeResponse(List<Runnable> runnableList) |
protected List<Object> |
mergeStoreProc(List<Runnable> runnableList) |
List<voldemort.store.cachestore.voldeimpl.KeyValue> |
multiGets(List<voldemort.store.cachestore.Key> keys) |
List<voldemort.store.cachestore.voldeimpl.KeyValue> |
multiGets(List<voldemort.store.cachestore.Key> keys,
String queryStr) |
List<voldemort.store.cachestore.voldeimpl.KeyValue> |
multiPuts(List<voldemort.store.cachestore.voldeimpl.KeyValue> list) |
List<voldemort.store.cachestore.voldeimpl.KeyValue> |
multiPuts(List<voldemort.store.cachestore.voldeimpl.KeyValue> list,
String queryStr) |
List<voldemort.store.cachestore.voldeimpl.KeyValue> |
multiRemoves(List<voldemort.store.cachestore.Key> keys) |
ClusterClient.ClusterCursor |
nextCursor(ClusterClient.ClusterCursor clusterCursor)
nextCursor will continue call to each cluster node to iterate through server side cursor
isEnd() return true, mean the end of cursor for each cluster
|
ClusterClient.ClusterCursor |
openKeyCursor(short batchSize) |
ClusterClient.ClusterCursor |
openKeyValueCursor(short batchSize)
Table scan of key set to return List
|
ClusterClient.ClusterCursor |
openScanCursor(short batchSize,
voldemort.store.cachestore.Key from,
voldemort.store.cachestore.Key to) |
void |
pack(int rate) |
void |
put(voldemort.store.cachestore.Key key,
Object data) |
void |
put(voldemort.store.cachestore.Key key,
voldemort.store.cachestore.Value value) |
List<voldemort.store.cachestore.voldeimpl.KeyValue> |
query(String queryStr) |
List<String> |
query4Json(String queryStr) |
protected List<ClusterClient.KeyCluster> |
rebalance(List<ClusterClient.KeyCluster> list) |
boolean |
remove(voldemort.store.cachestore.Key key) |
List<voldemort.store.cachestore.voldeimpl.KeyValue> |
scan(voldemort.store.cachestore.Key from) |
List<voldemort.store.cachestore.voldeimpl.KeyValue> |
scan(voldemort.store.cachestore.Key from,
voldemort.store.cachestore.Key to) |
List<voldemort.store.cachestore.voldeimpl.KeyValue> |
scan(voldemort.store.cachestore.Key from,
voldemort.store.cachestore.Key to,
String queryStr)
OpType to determine deserialze payload during merge
MultiGets means payload is byte[], else payload is serialized object
|
voldemort.store.cachestore.Value |
selectQuery(voldemort.store.cachestore.Key key,
String queryStr) |
void |
setClientType(TCPClientFactory.ClientType clientType) |
void |
setHashFunction(Hash hash) |
void |
setNio(boolean nio) |
void |
setSerializeTpe(Header.SerializableType serializeTpe)
to support return as json string,using Header.SerializableType.Json
|
void |
setStore(String store) |
void |
setTimeout(long timeout)
set connection timeout
|
void |
shutdown() |
int |
size() |
void |
updateQuery(voldemort.store.cachestore.Key key,
voldemort.store.cachestore.Value value,
String queryStr) |
protected Serializer serializer
protected String store
protected ClientConnections clientConnections
protected long timeout
protected volatile boolean nio
protected Serializer embeddedSerializer
protected TCPClientFactory.ClientType clientType
public ClusterClient(List<ClusterNodes> clusterNodesList, String store, Serializer serializer, TCPClientFactory.ClientType clientType)
public String getStore()
public void setStore(String store)
public void setTimeout(long timeout)
timeout
- public void setNio(boolean nio)
public void setClientType(TCPClientFactory.ClientType clientType)
public void setSerializeTpe(Header.SerializableType serializeTpe)
serializeTpe
- public void setHashFunction(Hash hash)
public void put(voldemort.store.cachestore.Key key, Object data)
put
in interface Persistence
public void insert(voldemort.store.cachestore.Key key, voldemort.store.cachestore.Value value)
insert
in interface StorePersistence
public void put(voldemort.store.cachestore.Key key, voldemort.store.cachestore.Value value)
put
in interface StorePersistence
public voldemort.store.cachestore.Value get(voldemort.store.cachestore.Key key)
get
in interface Persistence
get
in interface StorePersistence
public boolean remove(voldemort.store.cachestore.Key key)
remove
in interface Persistence
public voldemort.store.cachestore.Value selectQuery(voldemort.store.cachestore.Key key, String queryStr)
public void updateQuery(voldemort.store.cachestore.Key key, voldemort.store.cachestore.Value value, String queryStr)
public List<voldemort.store.cachestore.voldeimpl.KeyValue> scan(voldemort.store.cachestore.Key from, voldemort.store.cachestore.Key to)
scan
in interface ScanPersistence
from
- to
- public List<voldemort.store.cachestore.voldeimpl.KeyValue> scan(voldemort.store.cachestore.Key from, voldemort.store.cachestore.Key to, String queryStr)
from
- to
- queryStr
- protected Request createScanRequest(ScanParaList scanParaList)
protected Request createCursorRequest(CursorPara cursorPara)
public List<voldemort.store.cachestore.voldeimpl.KeyValue> multiGets(List<voldemort.store.cachestore.Key> keys, String queryStr)
public List<voldemort.store.cachestore.voldeimpl.KeyValue> multiGets(List<voldemort.store.cachestore.Key> keys)
multiGets
in interface ScanPersistence
public List<voldemort.store.cachestore.voldeimpl.KeyValue> multiPuts(List<voldemort.store.cachestore.voldeimpl.KeyValue> list, String queryStr)
public List<voldemort.store.cachestore.voldeimpl.KeyValue> multiPuts(List<voldemort.store.cachestore.voldeimpl.KeyValue> list)
multiPuts
in interface ScanPersistence
public List<voldemort.store.cachestore.voldeimpl.KeyValue> scan(voldemort.store.cachestore.Key from)
scan
in interface ScanPersistence
public List<voldemort.store.cachestore.voldeimpl.KeyValue> multiRemoves(List<voldemort.store.cachestore.Key> keys)
protected List<voldemort.store.cachestore.voldeimpl.KeyValue> findList(List<voldemort.store.cachestore.Key> keys, List<voldemort.store.cachestore.voldeimpl.KeyValue> keyValues)
protected List<voldemort.store.cachestore.Key> getKeyList(List<voldemort.store.cachestore.voldeimpl.KeyValue> list)
public ClusterClient.ClusterCursor openScanCursor(short batchSize, voldemort.store.cachestore.Key from, voldemort.store.cachestore.Key to)
public ClusterClient.ClusterCursor openKeyCursor(short batchSize)
public ClusterClient.ClusterCursor openKeyValueCursor(short batchSize)
batchSize
- public ClusterClient.ClusterCursor nextCursor(ClusterClient.ClusterCursor clusterCursor)
clusterCursor
- public ClusterClient.ClusterCursor mergeCluster(List<Runnable> runnableList, ClusterClient.ClusterCursor clusterCursor)
protected List<voldemort.store.cachestore.voldeimpl.KeyValue> mergeResponse(List<Runnable> runnableList)
protected Request create4GetPutRequest(List list, OpType opType, String queryStr)
public Future clusterStoreProcFuture(Invoker invoker, List<voldemort.store.cachestore.Key> keys)
invoker
- keys
- public List<Object> invoke(Invoker invoker)
invoker
- public List<Object> invokeMapReduce(Invoker invoker)
invoker
- public List<Object> clusterStoreProc(Invoker invoker, List<voldemort.store.cachestore.Key> keys)
invoker
- keys
- list of keys to send to cluster of nodespublic List<Object> clusterStoreProc(Invoker invoker, List<voldemort.store.cachestore.Key> keys, String queryStr)
protected List<ClusterClient.KeyCluster> rebalance(List<ClusterClient.KeyCluster> list)
protected List<Object> executeStoreProc(Invoker invoker, List<ClusterClient.KeyCluster> keyClusterList, boolean addKey)
protected List<Object> executeStoreProc(Invoker invoker, List<ClusterClient.KeyCluster> keyClusterList, boolean addKey, String queryStr)
protected List<ClusterClient.KeyCluster> findAll()
protected List<ClusterClient.KeyCluster> findKeyGroups(List<voldemort.store.cachestore.Key> list)
protected void findKeyCluster(voldemort.store.cachestore.Key key, List<ClusterClient.KeyCluster> list)
public void close()
close
in interface Persistence
public void shutdown()
public Iterator getKeyIterator()
getKeyIterator
in interface Persistence
public int size()
size
in interface Persistence
public void pack(int rate)
pack
in interface Persistence
public void backup(String path, int rate)
backup
in interface Persistence
Copyright © 2016. All rights reserved.