voldemort.store.serialized
Class SerializingStorageEngine<K,V,T>

java.lang.Object
  extended by voldemort.store.serialized.SerializingStore<K,V,T>
      extended by voldemort.store.serialized.SerializingStorageEngine<K,V,T>
Type Parameters:
K - The key type
V - The value type
T - the transforms type
All Implemented Interfaces:
StorageEngine<K,V,T>, Store<K,V,T>

public class SerializingStorageEngine<K,V,T>
extends SerializingStore<K,V,T>
implements StorageEngine<K,V,T>

A StorageEngine that handles serialization to bytes, transforming each request to a request to StorageEngine


Constructor Summary
SerializingStorageEngine(StorageEngine<ByteArray,byte[],byte[]> innerStorageEngine, Serializer<K> keySerializer, Serializer<V> valueSerializer, Serializer<T> transformsSerializer)
           
 
Method Summary
 boolean beginBatchModifications()
          A lot of storage engines support efficient methods for performing large number of writes (puts/deletes) against the data source.
 boolean endBatchModifications()
           
 ClosableIterator<Pair<K,Versioned<V>>> entries()
          Get an iterator over pairs of entries in the store.
 ClosableIterator<Pair<K,Versioned<V>>> entries(int partition)
          Get an iterator over pairs of entries in a store's partition.
 boolean isPartitionAware()
          Is the data persistence aware of partitions? In other words is the data internally stored on a per partition basis or together
 boolean isPartitionScanSupported()
          Does the storage engine support efficient scanning of a single partition
 ClosableIterator<K> keys()
          Get an iterator over keys in the store.
 ClosableIterator<K> 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 truncate()
          Truncate all entries in the store
static
<K1,V1,T1> SerializingStorageEngine<K1,V1,T1>
wrap(StorageEngine<ByteArray,byte[],byte[]> s, Serializer<K1> k, Serializer<V1> v, Serializer<T1> t)
           
 
Methods inherited from class voldemort.store.serialized.SerializingStore
close, delete, get, getAll, getCapability, getKeySerializer, getName, getValueSerializer, getVersions, put, wrap
 
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, getCapability, getName, getVersions, put
 

Constructor Detail

SerializingStorageEngine

public SerializingStorageEngine(StorageEngine<ByteArray,byte[],byte[]> innerStorageEngine,
                                Serializer<K> keySerializer,
                                Serializer<V> valueSerializer,
                                Serializer<T> transformsSerializer)
Method Detail

wrap

public static <K1,V1,T1> SerializingStorageEngine<K1,V1,T1> wrap(StorageEngine<ByteArray,byte[],byte[]> s,
                                                                 Serializer<K1> k,
                                                                 Serializer<V1> v,
                                                                 Serializer<T1> t)

entries

public ClosableIterator<Pair<K,Versioned<V>>> 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<K,V,T>
Returns:
An iterator over the entries in this StorageEngine.

keys

public ClosableIterator<K> 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<K,V,T>
Returns:
An iterator over the keys in this StorageEngine.

entries

public ClosableIterator<Pair<K,Versioned<V>>> 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<K,V,T>
Parameters:
partition - partition whose entries are to be fetched
Returns:
An iterator over the entries in this StorageEngine.

keys

public ClosableIterator<K> 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<K,V,T>
Parameters:
partition - partition whose keys are to be fetched
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<K,V,T>

isPartitionAware

public boolean isPartitionAware()
Description copied from interface: StorageEngine
Is the data persistence aware of partitions? In other words is the data internally stored on a per partition basis or together

Specified by:
isPartitionAware in interface StorageEngine<K,V,T>
Returns:
Boolean indicating if the data persistence is partition aware

isPartitionScanSupported

public boolean isPartitionScanSupported()
Description copied from interface: StorageEngine
Does the storage engine support efficient scanning of a single partition

Specified by:
isPartitionScanSupported in interface StorageEngine<K,V,T>
Returns:
true if the storage engine implements the capability. false otherwise

beginBatchModifications

public boolean beginBatchModifications()
Description copied from interface: StorageEngine
A lot of storage engines support efficient methods for performing large number of writes (puts/deletes) against the data source. This method puts the storage engine in this batch write mode

Specified by:
beginBatchModifications in interface StorageEngine<K,V,T>
Returns:
true if the storage engine took successful action to switch to 'batch-write' mode

endBatchModifications

public boolean endBatchModifications()
Specified by:
endBatchModifications in interface StorageEngine<K,V,T>
Returns:
true if the storage engine successfully returned to normal mode


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