voldemort.client
Class SocketStoreClientFactory

java.lang.Object
  extended by voldemort.client.AbstractStoreClientFactory
      extended by 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.


Field Summary
static java.lang.String URL_SCHEME
           
 
Fields inherited from class voldemort.client.AbstractStoreClientFactory
clusterMapper, DEFAULT_ROUTING_TIMEOUT_MS, failureDetector, identifierString, logger, MAX_METADATA_REFRESH_ATTEMPTS
 
Constructor Summary
SocketStoreClientFactory(ClientConfig config)
           
 
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)
           
<K,V> StoreClient<K,V>
getStoreClient(java.lang.String storeName, InconsistencyResolver<Versioned<V>> resolver)
          Get a StoreClient for the given store.
<K,V,T> Store<K,V,T>
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, getCluster, getConfig, getCurrentJmxId, getFailureDetector, getNextJmxId, getRawStore, getRawStore, getRequestFormatType, getSerializerFactory, getStoreClient, getStoreDefs, validateUrls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_SCHEME

public static final java.lang.String URL_SCHEME
See Also:
Constant Field Values
Constructor Detail

SocketStoreClientFactory

public SocketStoreClientFactory(ClientConfig config)
Method Detail

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 StoreClient
V - The type of the value of the StoreClient
Parameters:
storeName - The name of the store
resolver - 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