voldemort.store.configuration
Class ConfigurationStorageEngine

java.lang.Object
  extended by voldemort.store.AbstractStore<K,V,T>
      extended by voldemort.store.AbstractStorageEngine<java.lang.String,java.lang.String,java.lang.String>
          extended by voldemort.store.configuration.ConfigurationStorageEngine
All Implemented Interfaces:
StorageEngine<java.lang.String,java.lang.String,java.lang.String>, Store<java.lang.String,java.lang.String,java.lang.String>

public class ConfigurationStorageEngine
extends AbstractStorageEngine<java.lang.String,java.lang.String,java.lang.String>

A FileSystem based Storage Engine to persist configuration metadata.
Used only by MetadataStore


Constructor Summary
ConfigurationStorageEngine(java.lang.String name, java.lang.String directory)
           
 
Method Summary
 boolean delete(java.lang.String key, Version version)
          Delete all entries prior to the given version
 ClosableIterator<Pair<java.lang.String,Versioned<java.lang.String>>> entries()
          Get an iterator over pairs of entries in the store.
 ClosableIterator<Pair<java.lang.String,Versioned<java.lang.String>>> entries(int partition)
          Get an iterator over pairs of entries in a store's partition.
 java.util.List<Versioned<java.lang.String>> get(java.lang.String key, java.lang.String transforms)
          Get the value associated with the given key
 java.util.Map<java.lang.String,java.util.List<Versioned<java.lang.String>>> getAll(java.lang.Iterable<java.lang.String> keys, java.util.Map<java.lang.String,java.lang.String> 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.util.List<Version> getVersions(java.lang.String key)
          Get the versions associated with the given key.
 ClosableIterator<java.lang.String> keys()
          Get an iterator over keys in the store.
 ClosableIterator<java.lang.String> keys(int partition)
          Get an iterator over keys in the store's partition Note that the iterator need not be threadsafe, and that it must be manually closed after use.
 void put(java.lang.String key, Versioned<java.lang.String> value, java.lang.String transforms)
          Associate the value with the key and version in this store
 void truncate()
          Truncate all entries in the store
 
Methods inherited from class voldemort.store.AbstractStorageEngine
beginBatchModifications, endBatchModifications, isPartitionAware, isPartitionScanSupported, multiVersionPut, resolveAndConstructVersionsToPersist
 
Methods inherited from class voldemort.store.AbstractStore
close, delete, get, getAll, getName, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface voldemort.store.Store
close, delete, get, getAll, getName, put
 

Constructor Detail

ConfigurationStorageEngine

public ConfigurationStorageEngine(java.lang.String name,
                                  java.lang.String directory)
Method Detail

entries

public ClosableIterator<Pair<java.lang.String,Versioned<java.lang.String>>> entries()
Description copied from interface: StorageEngine
Get an iterator over pairs of entries in the store. The key is the first element in the pair and the versioned value is the second element. Note that the iterator need not be threadsafe, and that it must be manually closed after use.

Specified by:
entries in interface StorageEngine<java.lang.String,java.lang.String,java.lang.String>
Overrides:
entries in class AbstractStorageEngine<java.lang.String,java.lang.String,java.lang.String>
Returns:
An iterator over the entries in this StorageEngine.

entries

public ClosableIterator<Pair<java.lang.String,Versioned<java.lang.String>>> entries(int partition)
Description copied from interface: StorageEngine
Get an iterator over pairs of entries in a store's partition. The key is the first element in the pair and the versioned value is the second element. Note that the iterator need not be threadsafe, and that it must be manually closed after use.

Specified by:
entries in interface StorageEngine<java.lang.String,java.lang.String,java.lang.String>
Overrides:
entries in class AbstractStorageEngine<java.lang.String,java.lang.String,java.lang.String>
Parameters:
partition - partition whose entries are to be fetched
Returns:
An iterator over the entries in this StorageEngine.

keys

public ClosableIterator<java.lang.String> keys(int partition)
Description copied from interface: StorageEngine
Get an iterator over keys in the store's partition Note that the iterator need not be threadsafe, and that it must be manually closed after use.

Specified by:
keys in interface StorageEngine<java.lang.String,java.lang.String,java.lang.String>
Overrides:
keys in class AbstractStorageEngine<java.lang.String,java.lang.String,java.lang.String>
Parameters:
partition - partition whose keys are to be fetched
Returns:
An iterator over the keys in this StorageEngine.

delete

public boolean delete(java.lang.String key,
                      Version version)
               throws VoldemortException
Description copied from interface: Store
Delete all entries prior to the given version

Specified by:
delete in interface Store<java.lang.String,java.lang.String,java.lang.String>
Overrides:
delete in class AbstractStore<java.lang.String,java.lang.String,java.lang.String>
Parameters:
key - The key to delete
version - The current value of the key
Returns:
True if anything was deleted
Throws:
VoldemortException

get

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

Specified by:
get in interface Store<java.lang.String,java.lang.String,java.lang.String>
Overrides:
get in class AbstractStore<java.lang.String,java.lang.String,java.lang.String>
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

getVersions

public java.util.List<Version> getVersions(java.lang.String key)
Description copied from interface: Store
Get the versions associated with the given key. This is used in a put call to write a new value for this key

Specified by:
getVersions in interface Store<java.lang.String,java.lang.String,java.lang.String>
Overrides:
getVersions in class AbstractStore<java.lang.String,java.lang.String,java.lang.String>
Parameters:
key - The key to retrieve the versions for
Returns:
List of Versions associated with this key.

getAll

public java.util.Map<java.lang.String,java.util.List<Versioned<java.lang.String>>> getAll(java.lang.Iterable<java.lang.String> keys,
                                                                                          java.util.Map<java.lang.String,java.lang.String> 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<java.lang.String,java.lang.String,java.lang.String>
Overrides:
getAll in class AbstractStore<java.lang.String,java.lang.String,java.lang.String>
Parameters:
keys - The keys to check for.
Returns:
A Map of keys to a list of versioned values.
Throws:
VoldemortException

put

public void put(java.lang.String key,
                Versioned<java.lang.String> value,
                java.lang.String transforms)
         throws VoldemortException
Description copied from interface: Store
Associate the value with the key and version in this store

Specified by:
put in interface Store<java.lang.String,java.lang.String,java.lang.String>
Overrides:
put in class AbstractStore<java.lang.String,java.lang.String,java.lang.String>
Parameters:
key - The key to use
value - The value to store and its version.
Throws:
VoldemortException

getCapability

public java.lang.Object getCapability(StoreCapabilityType capability)
Description copied from interface: Store
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.

Specified by:
getCapability in interface Store<java.lang.String,java.lang.String,java.lang.String>
Overrides:
getCapability in class AbstractStore<java.lang.String,java.lang.String,java.lang.String>
Parameters:
capability - The capability type to retrieve
Returns:
The given capaiblity

keys

public ClosableIterator<java.lang.String> keys()
Description copied from interface: StorageEngine
Get an iterator over keys in the store. Note that the iterator need not be threadsafe, and that it must be manually closed after use.

Specified by:
keys in interface StorageEngine<java.lang.String,java.lang.String,java.lang.String>
Overrides:
keys in class AbstractStorageEngine<java.lang.String,java.lang.String,java.lang.String>
Returns:
An iterator over the keys in this StorageEngine.

truncate

public void truncate()
Description copied from interface: StorageEngine
Truncate all entries in the store

Specified by:
truncate in interface StorageEngine<java.lang.String,java.lang.String,java.lang.String>
Overrides:
truncate in class AbstractStorageEngine<java.lang.String,java.lang.String,java.lang.String>


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