public class ClientConnections extends Object
Modifier and Type | Field and Description |
---|---|
protected TCPClientFactory.ClientType |
clientType |
protected boolean |
nio |
protected AtomicLong |
seqno |
protected Header.SerializableType |
type |
Constructor and Description |
---|
ClientConnections(List<ClusterNodes> clusterNodesList,
Serializer serializer) |
ClientConnections(List<ClusterNodes> clusterNodesList,
Serializer serializer,
TCPClientFactory.ClientType clientType) |
Modifier and Type | Method and Description |
---|---|
void |
connectAll() |
Request |
createRequest(byte[] payload,
String store) |
Request |
createRequest(byte[] payload,
String store,
Request.RequestType type) |
protected Client |
findConnection(int hashCode,
List<Connection> connectionList) |
TCPClientFactory.ClientType |
getClientType() |
ConcurrentMap<Short,List<Connection>> |
getClusterConnections() |
String |
getClusterNodeStr() |
Client |
getConnection(voldemort.store.cachestore.Key key)
add hash interface if there is customize hash function
if not set, return key.hashCode()
|
Client |
getConnection(short cluster,
int index) |
String |
getConnectionList() |
List<voldemort.utils.Pair<voldemort.utils.Pair<Short,Integer>,String>> |
getMapClientFromAll() |
List<voldemort.utils.Pair<Short,Integer>> |
getOneFromAllCluster()
for those function which did not have keySet reference
It will random select one node from cluster
|
Short |
getPartition(voldemort.store.cachestore.Key key) |
voldemort.utils.Pair<Short,Integer> |
getPartitionIndex(voldemort.store.cachestore.Key key) |
ConcurrentMap<Integer,Short> |
getPartitionMap() |
int |
getPartitionNo(voldemort.store.cachestore.Key key) |
long |
getTimeout() |
int |
getTotalPartition() |
Header.SerializableType |
getType() |
void |
setClientType(TCPClientFactory.ClientType clientType) |
void |
setHash(Hash hash)
set cutomer hash function
|
void |
setNio(boolean nio) |
void |
setTimeout(long timeout) |
void |
setType(Header.SerializableType type) |
void |
shutdown() |
void |
stop() |
protected AtomicLong seqno
protected volatile boolean nio
protected TCPClientFactory.ClientType clientType
protected Header.SerializableType type
public ClientConnections(List<ClusterNodes> clusterNodesList, Serializer serializer)
public ClientConnections(List<ClusterNodes> clusterNodesList, Serializer serializer, TCPClientFactory.ClientType clientType)
public Header.SerializableType getType()
public void setType(Header.SerializableType type)
public TCPClientFactory.ClientType getClientType()
public Client getConnection(voldemort.store.cachestore.Key key)
key
- public Client getConnection(short cluster, int index)
public void setHash(Hash hash)
hash
- public void setNio(boolean nio)
public void setClientType(TCPClientFactory.ClientType clientType)
public String getConnectionList()
public Short getPartition(voldemort.store.cachestore.Key key)
public int getPartitionNo(voldemort.store.cachestore.Key key)
public ConcurrentMap<Integer,Short> getPartitionMap()
public voldemort.utils.Pair<Short,Integer> getPartitionIndex(voldemort.store.cachestore.Key key)
public List<voldemort.utils.Pair<Short,Integer>> getOneFromAllCluster()
public List<voldemort.utils.Pair<voldemort.utils.Pair<Short,Integer>,String>> getMapClientFromAll()
public String getClusterNodeStr()
public long getTimeout()
public void setTimeout(long timeout)
public void stop()
public void shutdown()
public int getTotalPartition()
public ConcurrentMap<Short,List<Connection>> getClusterConnections()
protected Client findConnection(int hashCode, List<Connection> connectionList)
public Request createRequest(byte[] payload, String store, Request.RequestType type)
public void connectAll()
Copyright © 2016. All rights reserved.