ostore.read
Class ReadStage
java.lang.Object
|
+--ostore.read.ReadStage
- All Implemented Interfaces:
- EventHandlerIF, ProfilableIF, SingleThreadedEventHandlerIF
- public class ReadStage
- extends Object
- implements SingleThreadedEventHandlerIF, EventHandlerIF, ProfilableIF
The ReadStage
performs the read satisfying a
ReadReq
event. The ReadStage
implements the low-level
bytes read or slice read satisfying the BytesReadReq
or
SliceReadReq
, respectively.
The ReadStage
is a SandStorm stage that performs a read
satisfying a ReadReq
event.
The ReadStage
implements the low-level bytes
bytes read or slice read satisfying the BytesReadReq
or
SliceReadReq
, respectively.
The ReadStage
performs a ReadReq
by either
placing the requested bytes in a BytesReadResp
or the
requested blocks in a SliceReadResp
.
USAGE
To read bytes of an object
dispatch
a BytesReadReq
containing the
versionId
of the
object
to read, the
A-GUID
(tree_id
) of the
object
, the
Selection
to read, the fault_mode, and a
Map
of spare_blocks.
The local ReadStage
will receive the
BytesReadReq
event and return a
BytesReadResp
containing the bytes and any missing bytes
depending on the fault mode.
To read the blocks
that are
contained in a slice of an object
from the data
to the
root of an object
dispatch
a SliceReadReq
containing the
versionId
of the
object
to read, the
A-GUID
(tree_id
) of the
object
, the
Selection
to read, and the fault_mode
The local ReadStage
will receive the
SliceReadReq
event and return a
SliceReadResp
containing a Map
of the
blocks
read, a
Selection
of the
blocks
read, and a
Selection
of the
blocks
missing.
INITIALIZATION PARAMETERS
- node_id
NodeId
of the local server where this stage
is running.
- AlarmTimeout
- Period to timeout (in milliseconds)
- Version:
- $Id: ReadStage.java,v 1.50 2004/05/13 20:16:04 hweather Exp $
- Author:
- Hakim Weatherspoon
- See Also:
ReadReq
,
ReadResp
,
BytesReadReq
,
BytesReadResp
,
SliceReadReq
,
SliceReadResp
,
ReplicaStage
,
Selection
,
VerifiableBlock
,
DataObject
,
Btree.InteriorNode
,
DataObject.DataBlock
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReadStage
public ReadStage()
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