Tag Archives: ArbitraryInconsistencyResolver

Voldemort InconsistencyResolver types and usage

http://project-voldemort.com/javadoc/client/voldemort/versioning/InconsistencyResolver.html

Voldemort support :

  1. resolveConflict([null, null]) == null
  2. if t != null, then resolveConflict([null, t]) == resolveConflict([t, null]) == t

 

ArbitraryInconsistencyResolver : An inconsistency resolution strategy that always prefers the first of the two objects.

ChainedResolver :Apply the given inconsistency resolvers in order until there are 1 or fewer items left.

FailingInconsistencyResolver :An inconsistency resolver that does not attempt to resolve inconsistencies, but instead just throws an exception if one should occur.

MergingInconsistencyResolver :A strategy based on merging the objects in the list

Take two different versions of an object and combine them into a single version of the object Implementations must maintain the contract that

 

TimeBasedInconsistencyResolver :Resolve inconsistencies based on timestamp in the vector clock

VectorClockInconsistencyResolver :An inconsistency resolver that uses the object VectorClocks leaving only a set of concurrent versions remaining.

 

InconsistencyResolver can be  used as :

voldemort.client
Interface StoreClientFactory

All Known Implementing Classes:
AbstractStoreClientFactoryHttpStoreClientFactoryMockStoreClientFactorySocketStoreClientFactory

public interface StoreClientFactory

An abstraction the represents a connection to a Voldemort cluster and can be used to create StoreClient instances to interact with individual stores. The factory abstracts away any connection pools, thread pools, or other details that will be shared by all the individual StoreClient

 

 


Method Summary
void close()
Close the store client
voldemort.cluster.failuredetector.FailureDetector getFailureDetector()
Returns the FailureDetector specific to the cluster against which this client factory is based.

<K,V> voldemort.store.Store<K,V>

getRawStore(java.lang.String storeName, InconsistencyResolver<Versioned<V>> 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>> inconsistencyResolver)
Get a StoreClient for the given store.

 

http://code.google.com/p/project-voldemort/source/browse/trunk/src/java/voldemort/client/AbstractStoreClientFactory.java?r=386

 

// Add inconsistency resolving decorator, using their inconsistency
// resolver (if they gave us one)
InconsistencyResolver<Versioned<V>> secondaryResolver = resolver == null ? new TimeBasedInconsistencyResolver()
: resolver;
serializedStore = new InconsistencyResolvingStore<K, V>(serializedStore,
new ChainedResolver<Versioned<V>>(new VectorClockInconsistencyResolver(),
secondaryResolver));

VectorClockInconsistencyResolver is always the first Resolver.

TimeBasedInconsistencyResolver is the default secondary Resolver if we do not set the  InconsistencyResolver in getStoreClient for StoreClientFactory

 

The Voldemort source code: http://code.google.com/p/project-voldemort/source/browse/trunk/src/java/?r=386