voldemort.client
Class MockStoreClientFactory

java.lang.Object
  extended by voldemort.client.MockStoreClientFactory
All Implemented Interfaces:
StoreClientFactory

public class MockStoreClientFactory
extends java.lang.Object
implements StoreClientFactory

A store client that produces non-persistent, in-memory stores. This is useful for unit testing.


Constructor Summary
MockStoreClientFactory(Serializer<?> keySerializer, Serializer<?> valueSerializer, Serializer<?> transformsSerializer)
           
MockStoreClientFactory(Serializer<?> keySerializer, Serializer<?> valueSerializer, Serializer<?> viewValueSerializer, Serializer<?> transformsSerializer, int nodeId, Time time)
           
MockStoreClientFactory(Serializer<?> keySerializer, Serializer<?> valueSerializer, Serializer<?> viewValueSerializer, Serializer<?> transformsSerializer, java.lang.String storesXml)
           
 
Method Summary
 void close()
          Close the store client
 FailureDetector getFailureDetector()
          Returns the FailureDetector specific to the cluster against which this client factory is based.
<K1,V1,T1> Store<K1,V1,T1>
getRawStore(java.lang.String storeName, InconsistencyResolver<Versioned<V1>> resolver)
          Get the underlying store, not the public StoreClient interface
<K,V> StoreClient<K,V>
getStoreClient(java.lang.String storeName)
          Get a StoreClient for the given store.
<K,V> StoreClient<K,V>
getStoreClient(java.lang.String storeName, InconsistencyResolver<Versioned<V>> resolver)
          Get a StoreClient for the given store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockStoreClientFactory

public MockStoreClientFactory(Serializer<?> keySerializer,
                              Serializer<?> valueSerializer,
                              Serializer<?> transformsSerializer)

MockStoreClientFactory

public MockStoreClientFactory(Serializer<?> keySerializer,
                              Serializer<?> valueSerializer,
                              Serializer<?> viewValueSerializer,
                              Serializer<?> transformsSerializer,
                              java.lang.String storesXml)

MockStoreClientFactory

public MockStoreClientFactory(Serializer<?> keySerializer,
                              Serializer<?> valueSerializer,
                              Serializer<?> viewValueSerializer,
                              Serializer<?> transformsSerializer,
                              int nodeId,
                              Time time)
Method Detail

getStoreClient

public <K,V> StoreClient<K,V> getStoreClient(java.lang.String storeName)
Description copied from interface: StoreClientFactory
Get a StoreClient for the given store.

Specified by:
getStoreClient in interface StoreClientFactory
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
Returns:
A fully constructed StoreClient

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
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

getRawStore

public <K1,V1,T1> Store<K1,V1,T1> getRawStore(java.lang.String storeName,
                                              InconsistencyResolver<Versioned<V1>> resolver)
Description copied from interface: StoreClientFactory
Get the underlying store, not the public StoreClient interface

Specified by:
getRawStore in interface StoreClientFactory
Parameters:
storeName - The name of the store
resolver - The inconsistency resolver
Returns:
The appropriate store

close

public void close()
Description copied from interface: StoreClientFactory
Close the store client

Specified by:
close in interface StoreClientFactory

getFailureDetector

public FailureDetector getFailureDetector()
Description copied from interface: StoreClientFactory
Returns the FailureDetector specific to the cluster against which this client factory is based.

Specified by:
getFailureDetector in interface StoreClientFactory
Returns:
FailureDetector


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu