|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.dataobj.DataObject
Nested Class Summary | |
---|---|
static class |
DataObject.DataBlock
The DataBlock object is stored at the leaves of the Btree. |
Field Summary | |
---|---|
static boolean |
DEBUG
|
static int |
FLAT_OBJECT
A constant to refer to the type of DataObject's that do not include an index. |
static int |
INDEXED_OBJECT
A constant to refer to the type of DataObject's that include an index. |
Constructor Summary | |
---|---|
DataObject(DataObject data_obj)
|
|
DataObject(InputBuffer buffer)
|
|
DataObject(int type,
SecureHash active_guid,
SignedQS signed_create_request,
SignedQS signed_prcert,
Acl acl,
int block_size)
|
|
DataObject(int type,
SecureHash active_guid,
SignedQS signed_create_request,
SignedQS signed_prcert,
Acl acl,
SecureHash last_ckpt_guid,
QSArray last_log_guid,
boolean is_log,
int block_size)
|
|
DataObject(int type,
SecureHash active_guid,
SignedQS signed_create_request,
SignedQS signed_prcert,
Acl acl,
SecureHash last_ckpt_guid,
QSArray last_log_guid,
boolean is_log,
int block_size,
byte[] data)
|
Method Summary | |
---|---|
void |
append(InputBuffer data_buffer,
int length,
DataObjectAppendException except,
CacheablePinned memory_handle,
DataCache cache)
|
DataObject |
begin()
|
SecureHash |
commit(DataCache cache)
|
SecureHash |
computeGuid()
Compute and return the guid of the object. |
SecureHash |
computeVhash()
Compute and return the verification hash of the object. |
static DataObject |
fromGuidBytes(byte[] data,
int[] offset)
|
Btree |
getBtree()
Returns the btree containing the data of the object. |
SecureHash |
getFhash()
Return the secure hash at the root of the verification tree constructed from the erasure-encoded fragments of a block. |
QuickSerializable |
getFromMetadata(int field)
|
QuickSerializable |
getFromMetadata(String field)
|
byte[] |
getInlinedData()
Returns the inlined data. |
Metadata |
getMetadata()
|
static int |
getTopBlockSize(int btree_block_size)
|
boolean |
isDataInlined()
Reports whether the data is inlined or in a btree. |
boolean |
isIndexed()
|
byte[] |
read(int start,
int length,
DataCache cache)
|
byte[] |
read(int start,
int length,
DataObjectReadException except,
DataCache cache)
|
byte[] |
read(Selection sel,
DataCache cache)
|
byte[] |
read(Selection sel,
DataCache cache,
DataObjectReadException except)
|
byte[] |
readIndex(KeyedSelection key_sel,
DataCache cache,
DataObjectReadException except)
|
Set |
readSlice(int start,
int length,
DataCache cache)
|
Set |
readSlice(int start,
int length,
DataObjectReadSliceException except,
DataCache cache)
|
void |
replace(InputBuffer data_buffer,
int start,
int length,
DataObjectReplaceException except,
CacheablePinned memory_handle,
DataCache cache)
|
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 |
setInMetadata(int field,
QuickSerializable value)
|
void |
setInMetadata(String field,
QuickSerializable value)
|
void |
toGuidBytes(byte[] data,
int[] offset)
Serialize the object in a form suitable for computing the block guid of the object. |
void |
toVhashBytes(byte[] data,
int[] offset)
Serialize the object in a form suitable for computing the verification hash of the object. |
void |
truncate()
|
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, toString, wait, wait, wait |
Field Detail |
public static final boolean DEBUG
public static final int INDEXED_OBJECT
public static final int FLAT_OBJECT
Constructor Detail |
public DataObject(int type, SecureHash active_guid, SignedQS signed_create_request, SignedQS signed_prcert, Acl acl, int block_size)
public DataObject(int type, SecureHash active_guid, SignedQS signed_create_request, SignedQS signed_prcert, Acl acl, SecureHash last_ckpt_guid, QSArray last_log_guid, boolean is_log, int block_size)
public DataObject(int type, SecureHash active_guid, SignedQS signed_create_request, SignedQS signed_prcert, Acl acl, SecureHash last_ckpt_guid, QSArray last_log_guid, boolean is_log, int block_size, byte[] data)
public DataObject(DataObject data_obj)
public DataObject(InputBuffer buffer) throws QSException
Method Detail |
public static DataObject fromGuidBytes(byte[] data, int[] offset) throws QSException
QSException
public DataObject begin()
public SecureHash commit(DataCache cache)
public static int getTopBlockSize(int btree_block_size)
public boolean isIndexed()
public Metadata getMetadata()
public QuickSerializable getFromMetadata(int field)
public QuickSerializable getFromMetadata(String field)
public void setInMetadata(int field, QuickSerializable value)
public void setInMetadata(String field, QuickSerializable value)
public boolean isDataInlined()
true
if the data is inlined,
false
public byte[] getInlinedData()
null
if the data is not inlinedpublic Btree getBtree()
null
if the data is inlinedpublic byte[] read(Selection sel, DataCache cache) throws DataObjectReadException
DataObjectReadException
public byte[] read(Selection sel, DataCache cache, DataObjectReadException except) throws DataObjectReadException
DataObjectReadException
public byte[] readIndex(KeyedSelection key_sel, DataCache cache, DataObjectReadException except) throws DataObjectReadException
DataObjectReadException
public byte[] read(int start, int length, DataCache cache) throws DataObjectReadException, ReadUnsatisfiableException
DataObjectReadException
ReadUnsatisfiableException
public byte[] read(int start, int length, DataObjectReadException except, DataCache cache) throws DataObjectReadException, ReadUnsatisfiableException
DataObjectReadException
ReadUnsatisfiableException
public Set readSlice(int start, int length, DataCache cache) throws DataObjectReadSliceException, ReadUnsatisfiableException
DataObjectReadSliceException
ReadUnsatisfiableException
public Set readSlice(int start, int length, DataObjectReadSliceException except, DataCache cache) throws DataObjectReadSliceException, ReadUnsatisfiableException
DataObjectReadSliceException
ReadUnsatisfiableException
public void truncate()
public void append(InputBuffer data_buffer, int length, DataObjectAppendException except, CacheablePinned memory_handle, DataCache cache) throws DataObjectAppendException
DataObjectAppendException
public void replace(InputBuffer data_buffer, int start, int length, DataObjectReplaceException except, CacheablePinned memory_handle, DataCache cache) throws DataObjectReplaceException
DataObjectReplaceException
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 to
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |