voldemort.store.views
Interface View<K,V,S,T>

Type Parameters:
K - The type of the key
V - The type of things in the view
S - The type of things in the store
T - The type of transform
All Known Implementing Classes:
AbstractViewTransformation

@Experimental
public interface View<K,V,S,T>

The interface for defining a view. This interface provides a translation from the view's type to the target store's type and vice versa. If one direction is not supported, the unimplemented method should throw an UnsupportedViewOperationException.


Method Summary
 V storeToView(Store<K,S,T> targetStore, K k, S s, T t)
          Translate from the store type to the view type
 S viewToStore(Store<K,S,T> targetStore, K k, V v, T t)
          Translate from the view type to the store type
 

Method Detail

storeToView

V storeToView(Store<K,S,T> targetStore,
              K k,
              S s,
              T t)
              throws UnsupportedViewOperationException
Translate from the store type to the view type

Parameters:
targetStore - The store behind the view
k - The key
s - The value for the store
t - the transforms to be applied on s
Returns:
The value for the view
Throws:
UnsupportedViewOperationException - If this direction of translation is not allowed

viewToStore

S viewToStore(Store<K,S,T> targetStore,
              K k,
              V v,
              T t)
              throws UnsupportedViewOperationException
Translate from the view type to the store type

Parameters:
targetStore - The store behind the view
k - The key
v - The value
t - the transforms to be applied on v
Returns:
The store type
Throws:
UnsupportedViewOperationException - If this direction of translation is not allowed


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