voldemort.store.logging
Class LoggingStore<K,V,T>

java.lang.Object
  extended by voldemort.store.AbstractStore<K,V,T>
      extended by voldemort.store.DelegatingStore<K,V,T>
          extended by voldemort.store.logging.LoggingStore<K,V,T>
All Implemented Interfaces:
Store<K,V,T>

public class LoggingStore<K,V,T>
extends DelegatingStore<K,V,T>

A store wrapper that handles debug logging.


Constructor Summary
LoggingStore(Store<K,V,T> store)
          Create a logging store that wraps the given store
LoggingStore(Store<K,V,T> store, java.lang.String instance, Time time)
          Create a logging store that wraps the given store
LoggingStore(Store<K,V,T> store, Time time)
          Create a logging store that wraps the given store
 
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 transform)
          Get the value associated with the given key
 java.lang.Object getCapability(StoreCapabilityType capability)
          Get some capability of the store.
 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 transform)
          Associate the value with the key and version in this store
 
Methods inherited from class voldemort.store.DelegatingStore
getAll, getAll, getInnerStore, getVersions, 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

LoggingStore

public LoggingStore(Store<K,V,T> store)
Create a logging store that wraps the given store

Parameters:
store - The store to wrap

LoggingStore

public LoggingStore(Store<K,V,T> store,
                    Time time)
Create a logging store that wraps the given store

Parameters:
store - The store to wrap
time - The time implementation to use for computing ellapsed time

LoggingStore

public LoggingStore(Store<K,V,T> store,
                    java.lang.String instance,
                    Time time)
Create a logging store that wraps the given store

Parameters:
store - The store to wrap
instance - The instance name to display in logging messages
time - The time implementation to use for computing ellapsed time
Method Detail

close

public void close()
           throws VoldemortException
Description copied from interface: Store
Close the store.

Specified by:
close in interface Store<K,V,T>
Overrides:
close in class DelegatingStore<K,V,T>
Throws:
VoldemortException - If closing fails.

delete

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

Specified by:
delete in interface Store<K,V,T>
Overrides:
delete in class DelegatingStore<K,V,T>
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<V>> get(K key,
                                        T transform)
                                 throws VoldemortException
Description copied from interface: Store
Get the value associated with the given key

Specified by:
get in interface Store<K,V,T>
Overrides:
get in class DelegatingStore<K,V,T>
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

put

public void put(K key,
                Versioned<V> value,
                T transform)
         throws VoldemortException
Description copied from interface: Store
Associate the value with the key and version in this store

Specified by:
put in interface Store<K,V,T>
Overrides:
put in class DelegatingStore<K,V,T>
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<K,V,T>
Overrides:
getCapability in class DelegatingStore<K,V,T>
Parameters:
capability - The capability type to retrieve
Returns:
The given capaiblity

get

public java.util.List<Versioned<V>> get(CompositeVoldemortRequest<K,V> request)
                                 throws VoldemortException
Description copied from interface: Store
Get the value associated with the given key

Specified by:
get in interface Store<K,V,T>
Overrides:
get in class DelegatingStore<K,V,T>
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

put

public void put(CompositeVoldemortRequest<K,V> request)
         throws VoldemortException
Description copied from interface: Store
Associate the value with the key and version in this store

Specified by:
put in interface Store<K,V,T>
Overrides:
put in class DelegatingStore<K,V,T>
Parameters:
request - Contains the key to use along with the value and version to use.
Throws:
VoldemortException

delete

public boolean delete(CompositeVoldemortRequest<K,V> request)
               throws VoldemortException
Description copied from interface: Store
Delete all entries prior to the given version

Specified by:
delete in interface Store<K,V,T>
Overrides:
delete in class DelegatingStore<K,V,T>
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