|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.read.ReadResp
A superclass for events sent from the ReadStage
to the
ReplicaStage
responding to ReadReq
events.
TODO: reuse same event for ClientStage->ReplicaStage
requests?
Field Summary | |
---|---|
protected SecureHash |
digest
The digest of this ReadResp .
|
protected int |
error_code
One of the error codes above (or NO_ERROR ). |
protected Selection |
missing
The portion of the DataObject that was not
successfully read, or null .
|
static int |
NO_ERROR
An error code that indicates no error occurred. |
protected Selection |
read
The portion of the DataObject that was successfully
read, or null . |
static int |
READ_ERROR
An error code that indicates a request failed because some portion of the requested data could not be read. |
protected SecureHash |
req_digest
A digest of the corresponding ReadReq . |
Constructor Summary | |
---|---|
protected |
ReadResp(InputBuffer buffer)
Constructs a ReadResp from its
serialize d form. |
protected |
ReadResp(ReadReq req,
Selection read,
Selection missing,
int error_code)
Constructs a new ReadResp for the specified
ReadReq . |
Method Summary | |
---|---|
SecureHash |
get_digest()
Returns the digest of this ReadResp .
|
int |
get_error_code()
Returns the error code. |
Selection |
get_missing()
Returns the Selection which describes the portion of
the DataObject that was not successfuly read. |
Selection |
get_read()
Returns the Selection which describes the portion of
the DataObject that was read. |
SecureHash |
get_req_digest()
Returns the digest over the corresponding ReadReq . |
QSLong |
get_req_seq_num()
Returns the sequence number of the request that generated this result. |
int |
hashCode()
Returns the hash of the digest of this ReadResp .
|
void |
serialize(OutputBuffer buffer)
Add the object to the buffer . |
boolean |
successful()
Returns true iff error_code() == NO_ERROR . |
String |
toString()
Returns a human-readable representation of this ReadResp . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int NO_ERROR
public static final int READ_ERROR
TODO: be more specific?
protected SecureHash req_digest
ReadReq
.
protected Selection read
DataObject
that was successfully
read, or null
.
protected Selection missing
DataObject
that was not
successfully read, or null
.
The union of read
and missing
should equal
the original requested Selection
.
protected int error_code
NO_ERROR
).
protected transient SecureHash digest
ReadResp
.
Do NOT include this field in to_bytes
.
Constructor Detail |
protected ReadResp(ReadReq req, Selection read, Selection missing, int error_code)
ReadResp
for the specified
ReadReq
.
protected ReadResp(InputBuffer buffer) throws QSException
ReadResp
from its
serialize
d form.
Method Detail |
public boolean successful()
true
iff error_code() == NO_ERROR
.
public int get_error_code()
public QSLong get_req_seq_num()
public SecureHash get_req_digest()
ReadReq
.
public Selection get_read()
Selection
which describes the portion of
the DataObject
that was read.
public Selection get_missing()
Selection
which describes the portion of
the DataObject
that was not successfuly read.
public SecureHash get_digest()
ReadResp
.
WARNING: the first invocation of this method may be expensive, because it requires serializing the entire object.
get_req_digest()
public void serialize(OutputBuffer buffer)
QuickSerializable
buffer
.
serialize
in interface QuickSerializable
buffer
- the output buffer to add the object topublic int hashCode()
ReadResp
.
WARNING: the first invocation of this method may be expensive, because it requires serializing the entire object.
hashCode
in class Object
public String toString()
ReadResp
.
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |