voldemort.client
Class SocketStoreClientFactory
java.lang.Object
voldemort.client.AbstractStoreClientFactory
voldemort.client.SocketStoreClientFactory
- All Implemented Interfaces:
- StoreClientFactory
public class SocketStoreClientFactory
- extends AbstractStoreClientFactory
A StoreClientFactory abstracts away the connection pooling, threading, and
bootstrapping mechanism. It can be used to create any number of
StoreClient instances for different
stores.
|
Method Summary |
void |
close()
Close the store client |
protected int |
getPort(Node node)
|
protected java.util.List<Versioned<java.lang.String>> |
getRemoteMetadata(java.lang.String key,
java.net.URI url)
|
protected Store<ByteArray,byte[],byte[]> |
getStore(java.lang.String storeName,
java.lang.String host,
int port,
RequestFormatType type)
|
|
getStoreClient(java.lang.String storeName,
InconsistencyResolver<Versioned<V>> resolver)
Get a StoreClient for the given store. |
|
getSystemStore(java.lang.String storeName,
java.lang.String clusterXml,
FailureDetector fd)
|
protected FailureDetector |
initFailureDetector(ClientConfig config,
Cluster cluster)
|
protected void |
validateUrl(java.net.URI url)
|
| Methods inherited from class voldemort.client.AbstractStoreClientFactory |
bootstrapMetadataWithRetries, bootstrapMetadataWithRetries, getClientContext, getConfig, getCurrentJmxId, getFailureDetector, getNextJmxId, getRawStore, getRawStore, getRequestFormatType, getSerializerFactory, getStoreClient, validateUrls |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URL_SCHEME
public static final java.lang.String URL_SCHEME
- See Also:
- Constant Field Values
SocketStoreClientFactory
public SocketStoreClientFactory(ClientConfig config)
getStoreClient
public <K,V> StoreClient<K,V> getStoreClient(java.lang.String storeName,
InconsistencyResolver<Versioned<V>> resolver)
- Description copied from interface:
StoreClientFactory
- Get a
StoreClient for the given store.
- Specified by:
getStoreClient in interface StoreClientFactory- Overrides:
getStoreClient in class AbstractStoreClientFactory
- Type Parameters:
K - The type of the key of the
StoreClientV - The type of the value of the
StoreClient- Parameters:
storeName - The name of the storeresolver - The
InconsistencyResolver that should be
used to resolve inconsistencies.
- Returns:
- A fully constructed
StoreClient
getRemoteMetadata
protected java.util.List<Versioned<java.lang.String>> getRemoteMetadata(java.lang.String key,
java.net.URI url)
- Overrides:
getRemoteMetadata in class AbstractStoreClientFactory
getStore
protected Store<ByteArray,byte[],byte[]> getStore(java.lang.String storeName,
java.lang.String host,
int port,
RequestFormatType type)
- Specified by:
getStore in class AbstractStoreClientFactory
initFailureDetector
protected FailureDetector initFailureDetector(ClientConfig config,
Cluster cluster)
- Specified by:
initFailureDetector in class AbstractStoreClientFactory
getPort
protected int getPort(Node node)
- Specified by:
getPort in class AbstractStoreClientFactory
validateUrl
protected void validateUrl(java.net.URI url)
- Specified by:
validateUrl in class AbstractStoreClientFactory
close
public void close()
- Description copied from interface:
StoreClientFactory
- Close the store client
- Specified by:
close in interface StoreClientFactory- Overrides:
close in class AbstractStoreClientFactory
getSystemStore
public <K,V,T> Store<K,V,T> getSystemStore(java.lang.String storeName,
java.lang.String clusterXml,
FailureDetector fd)
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu