ostore.archive
Class ArchivalStorageStage
java.lang.Object
  |
  +--ostore.archive.ArchivalStorageStage
- All Implemented Interfaces: 
 - EventHandlerIF, ProfilableIF, SingleThreadedEventHandlerIF
 
- public class ArchivalStorageStage
- extends Object
- implements SingleThreadedEventHandlerIF, EventHandlerIF, ProfilableIF
   
The ArchivalStorageStage is responsible for fulfilling the 
 server's roles as a Storage Server.  
 
 The ArchivalStorageStage handles requests to store and retrieve
 Disseminatables (e.g. Fragments 
 and Tombstones) and 
 VerifiableBlocks 
 (e.g. DataObjects, 
 InteriorNodes, and 
 DataBlocks).  In the former 
 case, the ArchivalStorageStage acts as a Storage Server.  
 In the latter case, the ArchivalStorageStage acts as a 
 RemoteCache.
 
 USAGE
  
 To store a Disseminatable (i.e. a Fragment), 
 dispatch a DisseminateFragMsg containing the 
 GUID of the Fragment, the A-GUID of the object that the 
 Fragment belongs, and the Fragment itself.
 The local ArchivalStorageStage will receive the
 disseminate request message and return a DisseminateFragAckMsg that
 either includes an ACK (i.e. the local server will store
 the Fragment) or a NACK (i.e. the local server will
 not store the Fragment because the 
 Fragment is corrupt or the server is already storing the fragment). 
 
 
 To retreive a Disseminatable (i.e. a Fragment), 
 dispatch a RequestFragMsg containing the 
 GUID of the Fragment and the A-GUID of the object that the 
 Fragment belongs.
 The local ArchivalStorageStage will receive the
 request message and return a RequestFragResponseMsg that
 includes the Fragment) or includes the actual
 VerifiableBlock.
 
 
 To discover if a node is willing to store 
 Disseminatables dispatch a 
 TypeRequestMsg to a random GUID.
 The DD will route the message to a node that
 closely matches the GUID.  If an ArchivalStorageStage
 is running on the local server and the server is willing to store 
 Disseminatables, than the server will return
 a TypeResponseMsg that includes a
 a MAC'd (i.e. Message Authenticated Certificate), stateing the servers
 willingness to store Disseminatables; otherwise,
 nothing will be returned.  
 
 INITIALIZATION PARAMETERS
  
  - node_id
 
  NodeId of the local server where this stage 
         is running. 
  - StorageServer
 
  - Willingness for local server to serve as a Storage Server 
      (true or false).
 
  
- Version: 
 
  - $Id: ArchivalStorageStage.java,v 1.35 2004/05/13 20:13:05 hweather Exp $
 
- Author: 
 
  - Hakim Weatherspoon
 
- See Also: 
 DisseminateFragMsg, 
DisseminateFragAckMsg, 
RequestFragMsg, 
RequestFragResponseMsg, 
TypeRequestMsg, 
TypeResponseMsg, 
Disseminatable, 
Fragment, 
VerifiableBlock, 
DataObject, 
Btree.InteriorNode, 
DataObject.DataBlock
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
ArchivalStorageStage
public ArchivalStorageStage()
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
 
init
public void init(ConfigDataIF config)
          throws Exception
- Specified by: 
 init in interface EventHandlerIF
 
Exception
 
destroy
public void destroy()
             throws Exception
- Specified by: 
 destroy in interface EventHandlerIF
 
Exception
 
profileSize
public int profileSize()
- Specified by: 
 profileSize in interface ProfilableIF