|
|||||||||||
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
QSException
public String toString()
toString
in class Object
public byte[] getData()
public int getSizeInBytes()
public SecureHash getFhash()
VerifiableBlock
getFhash
in interface VerifiableBlock
public void setFhash(SecureHash fhash)
VerifiableBlock
setFhash
in interface VerifiableBlock
fhash
- 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 VerifiableBlock
data
- See ostore.util.QuickSerializable.to_bytes
offset
- See ostore.util.QuickSerializable.to_bytes
public boolean verifyVhash(SecureHash vhash)
VerifiableBlock
verifyVhash
in interface VerifiableBlock
vhash
- the vhash against which to verify the object
true
iff the hash of the object matches
vhash
; false
otherwisepublic SecureHash computeGuid() throws BlockNotGuidVerifiableException
VerifiableBlock
computeGuid
in interface VerifiableBlock
BlockNotGuidVerifiableException
VerifiableBlock.setFhash(ostore.util.SecureHash)
public void toGuidBytes(byte[] data, int[] offset) throws BlockNotGuidVerifiableException
VerifiableBlock
toGuidBytes
in interface VerifiableBlock
data
- See ostore.util.QuickSerializable.to_bytes
offset
- See ostore.util.QuickSerializable.to_bytes
BlockNotGuidVerifiableException
public boolean verifyGuid(SecureHash guid) throws BlockNotGuidVerifiableException
VerifiableBlock
verifyGuid
in interface VerifiableBlock
guid
- the block guid against which to verify the object
true
iff the guid of the object matches
bguid
; false
otherwise
BlockNotGuidVerifiableException
public void serialize(OutputBuffer buffer)
QuickSerializable
buffer
.
serialize
in interface QuickSerializable
buffer
- the output buffer to add the object topublic boolean isDataNode()
isDataNode
in interface BtreeNode
public boolean isLeaf()
isLeaf
in interface BtreeNode
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |