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

All Known Subinterfaces:
StorageEngine<K,V,T>
All Known Implementing Classes:
AbstractStorageEngine, AbstractStore, BdbStorageEngine, CompressingStore, ConfigurationStorageEngine, DelegatingStore, FileBackedCachingStorageEngine, GzipStore, HttpStore, InconsistencyResolvingStore, InMemoryStorageEngine, InvalidMetadataCheckingStore, LoggingStore, MetadataStore, MysqlStorageEngine, PartitionPrefixedBdbStorageEngine, PipelineRoutedStore, QuotaLimitingStore, ReadOnlyStorageEngine, RebootstrappingStore, RedirectingStore, RetentionEnforcingStore, RoutedStore, SerializingStorageEngine, SerializingStore, SlopStorageEngine, SocketStore, StatTrackingStore, ThreadPoolRoutedStore, VersionIncrementingStore, ViewStorageEngine

public interface Store<K,V,T>

The basic interface used for storage and storage decorators. Allows the usual crud operations. Note that certain operations rely on the correct implementation of equals and hashCode for the key. As such, arrays as keys should be avoided.


Method Summary
 void close()
          Close the store.
 boolean delete(CompositeVoldemortRequest<K,V> request)
          Delete all entries prior to the given version
 boolean delete(K key, Version version)
          Delete all entries prior to the given version
 java.util.List<Versioned<V>> get(CompositeVoldemortRequest<K,V> request)
          Get the value associated with the given key
 java.util.List<Versioned<V>> get(K key, T transforms)
          Get the value associated with the given key
 java.util.Map<K,java.util.List<Versioned<V>>> getAll(CompositeVoldemortRequest<K,V> request)
          Get the values associated with the given keys and returns them in a Map of keys to a list of versioned values.
 java.util.Map<K,java.util.List<Versioned<V>>> getAll(java.lang.Iterable<K> keys, java.util.Map<K,T> transforms)
          Get the values associated with the given keys and returns them in a Map of keys to a list of versioned values.
 java.lang.Object getCapability(StoreCapabilityType capability)
          Get some capability of the store.
 java.lang.String getName()
           
 java.util.List<Version> getVersions(K key)
          Get the versions associated with the given key.
 void put(CompositeVoldemortRequest<K,V> request)
          Associate the value with the key and version in this store
 void put(K key, Versioned<V> value, T transforms)
          Associate the value with the key and version in this store
 

Method Detail

get

java.util.List<Versioned<V>> get(K key,
                                 T transforms)
                                 throws VoldemortException
Get the value associated with the given key

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

getAll

java.util.Map<K,java.util.List<Versioned<V>>> getAll(java.lang.Iterable<K> keys,
                                                     java.util.Map<K,T> transforms)
                                                     throws VoldemortException
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.

Parameters:
keys - The keys to check for.
Returns:
A Map of keys to a list of versioned values.
Throws:
VoldemortException

put

void put(K key,
         Versioned<V> value,
         T transforms)
         throws VoldemortException
Associate the value with the key and version in this store

Parameters:
key - The key to use
value - The value to store and its version.
Throws:
VoldemortException

delete

boolean delete(K key,
               Version version)
               throws VoldemortException
Delete all entries prior to the given version

Parameters:
key - The key to delete
version - The current value of the key
Returns:
True if anything was deleted
Throws:
VoldemortException

getName

java.lang.String getName()
Returns:
The name of the store.

close

void close()
           throws VoldemortException
Close the store.

Throws:
VoldemortException - If closing fails.

getCapability

java.lang.Object getCapability(StoreCapabilityType capability)
Get some capability of the store. Examples would be the serializer used, or the routing strategy. This provides a mechanism to verify that the store hierarchy has some set of capabilities without knowing the precise layering.

Parameters:
capability - The capability type to retrieve
Returns:
The given capaiblity
Throws:
NoSuchCapabilityException - if the capaibility is not present

getVersions

java.util.List<Version> getVersions(K key)
Get the versions associated with the given key. This is used in a put call to write a new value for this key

Parameters:
key - The key to retrieve the versions for
Returns:
List of Versions associated with this key.

get

java.util.List<Versioned<V>> get(CompositeVoldemortRequest<K,V> request)
                                 throws VoldemortException
Get the value associated with the given key

Parameters:
request - Contains the key to check for and associated transforms
Returns:
The value associated with the key or an empty list if no values are found.
Throws:
VoldemortException

getAll

java.util.Map<K,java.util.List<Versioned<V>>> getAll(CompositeVoldemortRequest<K,V> request)
                                                     throws VoldemortException
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.

Parameters:
request - Contains the keys to check for.
Returns:
A Map of keys to a list of versioned values.
Throws:
VoldemortException

put

void put(CompositeVoldemortRequest<K,V> request)
         throws VoldemortException
Associate the value with the key and version in this store

Parameters:
request - Contains the key to use along with the value and version to use.
Throws:
VoldemortException

delete

boolean delete(CompositeVoldemortRequest<K,V> request)
               throws VoldemortException
Delete all entries prior to the given version

Parameters:
request - Contains the key to delete and current version of the key
Returns:
True if anything was deleted
Throws:
VoldemortException


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