|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--ostore.dataobj.DataObject.DataBlock
The DataBlock object is stored at the leaves of the Btree. It holds the user data. Effectively, it is little more than an array of bytes.
| Field Summary | |
|---|---|
byte[] |
_bytes
|
static int |
overhead
|
| Constructor Summary | |
|---|---|
DataObject.DataBlock(InputBuffer buffer)
|
|
DataObject.DataBlock(int size)
|
|
| Method Summary | |
|---|---|
SecureHash |
computeGuid()
Compute and return the guid of the object. |
SecureHash |
computeVhash()
Compute and return the verification hash of the object. |
static DataObject.DataBlock |
fromGuidBytes(byte[] data,
int[] offset)
|
static DataObject.DataBlock |
fromGuidBytes(InputBuffer buffer)
|
byte[] |
getData()
|
SecureHash |
getFhash()
Return the secure hash at the root of the verification tree constructed from the erasure-encoded fragments of a block. |
int |
getSizeInBytes()
|
boolean |
isDataNode()
|
boolean |
isLeaf()
|
void |
serialize(OutputBuffer buffer)
Add the object to the buffer. |
void |
setFhash(SecureHash fhash)
Record the secure hash at the root of the verification tree constructed from the erasure-encoded fragments of a block. |
void |
toGuidBytes(byte[] data,
int[] offset)
Serialize the object in a form suitable for computing the block guid of the object. |
String |
toString()
|
void |
toVhashBytes(byte[] data,
int[] offset)
Serialize the object in a form suitable for computing the verification hash of the object. |
boolean |
verifyGuid(SecureHash guid)
Verify the contents of the object against its given guid. |
boolean |
verifyVhash(SecureHash vhash)
Verify the contents of the object against its given verification hash. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public byte[] _bytes
public static final int overhead
| Constructor Detail |
public DataObject.DataBlock(int size)
public DataObject.DataBlock(InputBuffer buffer)
throws QSException
| Method Detail |
public static DataObject.DataBlock fromGuidBytes(byte[] data,
int[] offset)
throws QSException
QSException
public static DataObject.DataBlock fromGuidBytes(InputBuffer buffer)
throws QSException
QSExceptionpublic String toString()
toString in class Objectpublic byte[] getData()
public int getSizeInBytes()
public SecureHash getFhash()
VerifiableBlock
getFhash in interface VerifiableBlockpublic void setFhash(SecureHash fhash)
VerifiableBlock
setFhash in interface VerifiableBlockfhash - the secure hash at the root of the verification treepublic SecureHash computeVhash()
VerifiableBlock
computeVhash in interface VerifiableBlock
public void toVhashBytes(byte[] data,
int[] offset)
VerifiableBlock
toVhashBytes in interface VerifiableBlockdata - See ostore.util.QuickSerializable.to_bytesoffset - See ostore.util.QuickSerializable.to_bytespublic boolean verifyVhash(SecureHash vhash)
VerifiableBlock
verifyVhash in interface VerifiableBlockvhash - the vhash against which to verify the object
true iff the hash of the object matches
vhash; false otherwise
public SecureHash computeGuid()
throws BlockNotGuidVerifiableException
VerifiableBlock
computeGuid in interface VerifiableBlockBlockNotGuidVerifiableExceptionVerifiableBlock.setFhash(ostore.util.SecureHash)
public void toGuidBytes(byte[] data,
int[] offset)
throws BlockNotGuidVerifiableException
VerifiableBlock
toGuidBytes in interface VerifiableBlockdata - See ostore.util.QuickSerializable.to_bytesoffset - See ostore.util.QuickSerializable.to_bytes
BlockNotGuidVerifiableException
public boolean verifyGuid(SecureHash guid)
throws BlockNotGuidVerifiableException
VerifiableBlock
verifyGuid in interface VerifiableBlockguid - the block guid against which to verify the object
true iff the guid of the object matches
bguid; false otherwise
BlockNotGuidVerifiableExceptionpublic void serialize(OutputBuffer buffer)
QuickSerializablebuffer.
serialize in interface QuickSerializablebuffer - the output buffer to add the object topublic boolean isDataNode()
isDataNode in interface BtreeNodepublic boolean isLeaf()
isLeaf in interface BtreeNode
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||