voldemort.store.retention
Class RetentionEnforcingStore

java.lang.Object
  extended by voldemort.store.AbstractStore<K,V,T>
      extended by voldemort.store.DelegatingStore<ByteArray,byte[],byte[]>
          extended by voldemort.store.retention.RetentionEnforcingStore
All Implemented Interfaces:
MetadataStoreListener, Store<ByteArray,byte[],byte[]>

public class RetentionEnforcingStore
extends DelegatingStore<ByteArray,byte[],byte[]>
implements MetadataStoreListener

Wraps the storage layer and ensures we don't return any values that are stale. Optionally, deletes the expired versions.


Constructor Summary
RetentionEnforcingStore(Store<ByteArray,byte[],byte[]> innerStore, StoreDefinition storeDef, boolean deleteExpiredEntries, Time time)
           
 
Method Summary
 java.util.List<Versioned<byte[]>> get(ByteArray key, byte[] transforms)
          Get the value associated with the given key
 java.util.Map<ByteArray,java.util.List<Versioned<byte[]>>> getAll(java.lang.Iterable<ByteArray> keys, java.util.Map<ByteArray,byte[]> transforms)
          Get the values associated with the given keys and returns them in a Map of keys to a list of versioned values.
 void updateRoutingStrategy(RoutingStrategy routingStrategyMap)
           
 void updateStoreDefinition(StoreDefinition storeDef)
          Updates the store definition object and the retention time based on the updated store definition
 
Methods inherited from class voldemort.store.DelegatingStore
close, delete, delete, get, getAll, getCapability, getInnerStore, getVersions, put, put, toString
 
Methods inherited from class voldemort.store.AbstractStore
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RetentionEnforcingStore

public RetentionEnforcingStore(Store<ByteArray,byte[],byte[]> innerStore,
                               StoreDefinition storeDef,
                               boolean deleteExpiredEntries,
                               Time time)
Method Detail

updateRoutingStrategy

public void updateRoutingStrategy(RoutingStrategy routingStrategyMap)
Specified by:
updateRoutingStrategy in interface MetadataStoreListener

updateStoreDefinition

public void updateStoreDefinition(StoreDefinition storeDef)
Updates the store definition object and the retention time based on the updated store definition

Specified by:
updateStoreDefinition in interface MetadataStoreListener

getAll

public java.util.Map<ByteArray,java.util.List<Versioned<byte[]>>> getAll(java.lang.Iterable<ByteArray> keys,
                                                                         java.util.Map<ByteArray,byte[]> transforms)
                                                                  throws VoldemortException
Description copied from interface: Store
Get the values associated with the given keys and returns them in a Map of keys to a list of versioned values. Note that the returned map will only contain entries for the keys which have a value associated with them.

Specified by:
getAll in interface Store<ByteArray,byte[],byte[]>
Overrides:
getAll in class DelegatingStore<ByteArray,byte[],byte[]>
Parameters:
keys - The keys to check for.
Returns:
A Map of keys to a list of versioned values.
Throws:
VoldemortException

get

public java.util.List<Versioned<byte[]>> get(ByteArray key,
                                             byte[] transforms)
                                      throws VoldemortException
Description copied from interface: Store
Get the value associated with the given key

Specified by:
get in interface Store<ByteArray,byte[],byte[]>
Overrides:
get in class DelegatingStore<ByteArray,byte[],byte[]>
Parameters:
key - The key to check for
Returns:
The value associated with the key or an empty list if no values are found.
Throws:
VoldemortException


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