voldemort.server.storage
Class StorageService

java.lang.Object
  extended by voldemort.common.service.AbstractService
      extended by voldemort.server.storage.StorageService
All Implemented Interfaces:
VoldemortService

public class StorageService
extends AbstractService

The service responsible for managing all storage types


Field Summary
static java.lang.String CLUSTER_VERSION_KEY
           
static java.lang.String STORES_VERSION_KEY
           
static java.lang.String VERSIONS_METADATA_STORE
           
 
Constructor Summary
StorageService(StoreRepository storeRepository, MetadataStore metadata, SchedulerService scheduler, VoldemortConfig config)
           
 
Method Summary
 void forceCleanupOldData(java.lang.String storeName)
           
 void forceCleanupOldDataThrottled(java.lang.String storeName, int entryScanThrottleRate)
           
 DynamicThrottleLimit getDynThrottleLimit()
           
 long getEntriesScanned()
           
 long getGrantedPermits()
           
 MetadataStore getMetadataStore()
           
 java.util.List<java.lang.String> getPermitOwners()
           
 SocketStoreFactory getSocketStoreFactory()
           
 StoreRepository getStoreRepository()
           
protected  void initializeMetadataVersions(java.util.List<StoreDefinition> storeDefs)
           
 void logStoreStats()
           
 void logStoreStats(java.lang.String storeName)
           
 void openStore(StoreDefinition storeDef)
           
 void openSystemStore(StoreDefinition storeDef)
           
 void registerEngine(StorageEngine<ByteArray,byte[],byte[]> engine, boolean isReadOnly, java.lang.String storeType, StoreDefinition storeDef)
          Register the given engine with the storage repository
 void registerInternalEngine(StorageEngine<ByteArray,byte[],byte[]> engine, boolean isReadOnly, java.lang.String storeType)
          Register the given internal engine (slop and metadata) with the storage repository
 void registerNodeStores(StoreDefinition def, Cluster cluster, int localNode)
          For server side routing create NodeStore (socketstore) and pass it on to a RebootstrappingStore.
 void registerSystemEngine(StorageEngine<ByteArray,byte[],byte[]> engine)
           
 void removeEngine(StorageEngine<ByteArray,byte[],byte[]> engine, boolean isReadOnly, java.lang.String storeType, boolean truncate)
          Unregister and remove the engine from the storage repository.
protected  void startInner()
           
protected  void stopInner()
           
 void unregisterSystemEngine(StorageEngine<ByteArray,byte[],byte[]> engine)
           
 void updateStore(StoreDefinition storeDef)
           
 
Methods inherited from class voldemort.common.service.AbstractService
getType, isStarted, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSIONS_METADATA_STORE

public static final java.lang.String VERSIONS_METADATA_STORE
See Also:
Constant Field Values

CLUSTER_VERSION_KEY

public static final java.lang.String CLUSTER_VERSION_KEY
See Also:
Constant Field Values

STORES_VERSION_KEY

public static final java.lang.String STORES_VERSION_KEY
See Also:
Constant Field Values
Constructor Detail

StorageService

public StorageService(StoreRepository storeRepository,
                      MetadataStore metadata,
                      SchedulerService scheduler,
                      VoldemortConfig config)
Method Detail

startInner

protected void startInner()
Specified by:
startInner in class AbstractService

initializeMetadataVersions

protected void initializeMetadataVersions(java.util.List<StoreDefinition> storeDefs)

openSystemStore

public void openSystemStore(StoreDefinition storeDef)

registerSystemEngine

public void registerSystemEngine(StorageEngine<ByteArray,byte[],byte[]> engine)

unregisterSystemEngine

public void unregisterSystemEngine(StorageEngine<ByteArray,byte[],byte[]> engine)

updateStore

public void updateStore(StoreDefinition storeDef)

openStore

public void openStore(StoreDefinition storeDef)

removeEngine

public void removeEngine(StorageEngine<ByteArray,byte[],byte[]> engine,
                         boolean isReadOnly,
                         java.lang.String storeType,
                         boolean truncate)
Unregister and remove the engine from the storage repository. This is called during deletion of stores and if there are exceptions adding/opening stores

Parameters:
engine - The actual engine to remove
isReadOnly - Is this read-only?
storeType - The storage type of the store
truncate - Should the store be truncated?

registerInternalEngine

public void registerInternalEngine(StorageEngine<ByteArray,byte[],byte[]> engine,
                                   boolean isReadOnly,
                                   java.lang.String storeType)
Register the given internal engine (slop and metadata) with the storage repository

Parameters:
engine - Register the storage engine
isReadOnly - Boolean indicating if this store is read-only
storeType - The type of the store

registerEngine

public void registerEngine(StorageEngine<ByteArray,byte[],byte[]> engine,
                           boolean isReadOnly,
                           java.lang.String storeType,
                           StoreDefinition storeDef)
Register the given engine with the storage repository

Parameters:
engine - Register the storage engine
isReadOnly - Boolean indicating if this store is read-only
storeType - The type of the store
storeDef - store definition for the store to be registered

registerNodeStores

public void registerNodeStores(StoreDefinition def,
                               Cluster cluster,
                               int localNode)
For server side routing create NodeStore (socketstore) and pass it on to a RebootstrappingStore.

The RebootstrappingStore handles invalid-metadata exceptions introduced due to changes in cluster.xml at different nodes.

Parameters:
def -
cluster -
localNode -

stopInner

protected void stopInner()
Specified by:
stopInner in class AbstractService

getMetadataStore

public MetadataStore getMetadataStore()

getStoreRepository

public StoreRepository getStoreRepository()

forceCleanupOldData

public void forceCleanupOldData(java.lang.String storeName)

forceCleanupOldDataThrottled

public void forceCleanupOldDataThrottled(java.lang.String storeName,
                                         int entryScanThrottleRate)

logStoreStats

public void logStoreStats(java.lang.String storeName)

logStoreStats

public void logStoreStats()

getSocketStoreFactory

public SocketStoreFactory getSocketStoreFactory()

getDynThrottleLimit

public DynamicThrottleLimit getDynThrottleLimit()

getPermitOwners

public java.util.List<java.lang.String> getPermitOwners()

getGrantedPermits

public long getGrantedPermits()

getEntriesScanned

public long getEntriesScanned()


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