ostore.cache
Class StorageManager

java.lang.Object
  |
  +--ostore.cache.StorageManager
All Implemented Interfaces:
EventHandlerIF, SingleThreadedEventHandlerIF

public class StorageManager
extends Object
implements EventHandlerIF, SingleThreadedEventHandlerIF

An asynchronous interface to BerkeleyDB for use by the BufferCache. The database schema used is
TableKeyData
_blocksSecureHash (VHASH)VerifiableBlock
_guidsSecureHash (GUID)SecureHash (VHASH)
_fragsSecureHash (GUID)Fragment


Nested Class Summary
static class StorageManager.GetBlock
          Get a block from the cache; one or more of id or vhash must be non-null.
static class StorageManager.GetBlockCompleted
          The result of any type of get.
static class StorageManager.PutBlock
          Add a data block to the cache, with or without a guid.
static class StorageManager.PutBlockCompleted
          Dispatched whenever a request is finished.
 
Field Summary
protected  int _block_tables
           
protected  com.sleepycat.db.Db[] _blocks
           
protected  Classifier _classifier
           
protected  com.sleepycat.db.DbEnv _env
           
protected  int _events_in_queue
           
protected  Object _events_in_queue_lock
           
protected  com.sleepycat.db.Db _frags
           
protected  com.sleepycat.db.Db _guids
           
protected static Map instances
           
protected  byte[] put_data_bytes
           
protected  CountBuffer put_data_cb
           
protected  ByteArrayOutputBuffer put_data_ob
           
 
Constructor Summary
StorageManager()
           
 
Method Summary
protected static void BUG(String msg)
           
 void destroy()
           
 int events_in_queue()
           
 void handleEvent(QueueElementIF item)
           
 void handleEvents(QueueElementIF[] items)
           
 void init(ConfigDataIF config)
           
static StorageManager instance(NodeId node_id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instances

protected static Map instances

put_data_bytes

protected byte[] put_data_bytes

put_data_ob

protected ByteArrayOutputBuffer put_data_ob

put_data_cb

protected CountBuffer put_data_cb

_events_in_queue

protected int _events_in_queue

_events_in_queue_lock

protected Object _events_in_queue_lock

_blocks

protected com.sleepycat.db.Db[] _blocks

_block_tables

protected int _block_tables

_guids

protected com.sleepycat.db.Db _guids

_frags

protected com.sleepycat.db.Db _frags

_classifier

protected Classifier _classifier

_env

protected com.sleepycat.db.DbEnv _env
Constructor Detail

StorageManager

public StorageManager()
Method Detail

instance

public static StorageManager instance(NodeId node_id)

init

public void init(ConfigDataIF config)
          throws Exception
Specified by:
init in interface EventHandlerIF
Exception

handleEvent

public void handleEvent(QueueElementIF item)
                 throws EventHandlerException
Specified by:
handleEvent in interface EventHandlerIF
EventHandlerException

handleEvents

public void handleEvents(QueueElementIF[] items)
                  throws EventHandlerException
Specified by:
handleEvents in interface EventHandlerIF
EventHandlerException

events_in_queue

public int events_in_queue()

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface EventHandlerIF
Exception

BUG

protected static final void BUG(String msg)