|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
DisseminatableBucket
is an interface to store all or a subset
of the disseminatables created for a single GUID.
DisseminatableBucket
is implemented by FragmentBucket
and TombstoneBucket
.
Method Summary | |
---|---|
void |
add(Disseminatable diss)
add a Disseminatable to this bucket. |
boolean |
canDecode()
Determine if we can decode this bucket's object. |
void |
clear()
clear frees internal data structures that can be
garbage collected. |
boolean |
getAcksRecv(int index)
getAcksRecv return true if disseminatable at given index
has been received; otherwise, false. |
Disseminatable |
getDisseminatable(int index)
getDisseminatable |
long |
getEndTime()
getEndTime returns the time the Bucket was
destroyed (i.e. removed from table). |
SecureHash |
getGuid()
getGuid returns the GUID that is the name of the
Disseminatables in this bucket. |
int |
getLength()
getLength return the total capacity of this bucket. |
int |
getNackCount()
getNackCount returns the number of NACK's received. |
SecureHash |
getNextBucket()
getNextBucket returns the SecureHash of the
next Bucket in this chain. |
int |
getNumAcksRecv()
getNumAcksRecv returns the number of ack's recv'd. |
int |
getNumBytes()
getNumBytes returns the total number of bytes stored
in this bucket. |
int |
getNumGood()
getNumGood returns the total number of
Disseminatables stored in this bucket. |
SecureHash |
getRefGuid()
getRefGuid returns the GUID that refers to this bucket
(in some higher-level hashtable). |
long |
getStartTime()
getStartTime returns the time the Bucket was
created (i.e. put on table). |
void |
incrNackCount()
incrNackCount |
boolean |
receivedAllAcks(double percentRequired)
receivedAllAcks returns true if all
Disseminatables have been
ack'd otherwise returns false. |
boolean |
recv(Disseminatable diss)
recv receives a Disseminatable (presumably from
the network) and adds it to this bucket.
|
void |
reset(NodeId node_id,
SecureHash node_guid)
clear frees internal data structures that can be
garbage collected. |
void |
setAckRecv(int index)
setAckRecv set that an acknowledgement has been
received at specified index . |
void |
setDecoded(boolean decoded)
setDecoded sets successfully decoded to specified
decoded .
|
void |
setEndTime(long time)
setEndTime sets the time the Bucket was destroyed
(i.e. removed from table). |
void |
setNextBucket(SecureHash bucket)
setNextBucket sets the next SecureHash of the next
Bucket in this chain. |
void |
setRefGuid(SecureHash guid)
setRefGuid sets the GUID that refers to this bucket
(in some higher-level hashtable). |
void |
setStartTime(long time)
setStartTime sets the time the Bucket was
created (i.e. put on table). |
boolean |
testAndSetDecoded()
testAndSetDecoded atomically tests if
successfullyDecoded. |
Methods inherited from interface ostore.util.QuickSerializable |
---|
serialize |
Method Detail |
public long getStartTime()
getStartTime
returns the time the Bucket was
created (i.e. put on table).
public long getEndTime()
getEndTime
returns the time the Bucket was
destroyed (i.e. removed from table).
public void setStartTime(long time)
setStartTime
sets the time the Bucket was
created (i.e. put on table).
time
- the time the Bucket was created (i.e. put on table).public void setEndTime(long time)
setEndTime
sets the time the Bucket was destroyed
(i.e. removed from table).
time
- the time the Bucket was destroyed (i.e. removed from
table).public int getNumBytes()
getNumBytes
returns the total number of bytes stored
in this bucket.
public SecureHash getNextBucket()
getNextBucket
returns the SecureHash
of the
next Bucket in this chain.
SecureHash
of the next bucket in this chain.public void setNextBucket(SecureHash bucket)
setNextBucket
sets the next SecureHash
of the next
Bucket in this chain.
bucket
- SecureHash
of the next bucket in this chain.public SecureHash getRefGuid()
getRefGuid
returns the GUID that refers to this bucket
(in some higher-level hashtable).
public void setRefGuid(SecureHash guid)
setRefGuid
sets the GUID that refers to this bucket
(in some higher-level hashtable).
guid
- guid that refers to this bucket.public SecureHash getGuid()
getGuid
returns the GUID that is the name of the
Disseminatables
in this bucket.
Disseminatables
in this bucket.public int getNumGood()
getNumGood
returns the total number of
Disseminatables
stored in this bucket.
Disseminatables
stored in this bucket.public int getLength()
getLength
return the total capacity of this bucket.
public Disseminatable getDisseminatable(int index)
getDisseminatable returns a single Disseminatable
at the specified index
.
- Parameters:
index
- index of the Disseminatable
to retrieve.
- Returns:
Disseminatable
that corresponds to index.
public int getNackCount()
getNackCount
returns the number of NACK's received.
public void incrNackCount()
incrNackCount increments the NACK count.
public void add(Disseminatable diss)
add
a Disseminatable
to this bucket.
diss
- Disseminatable
to add.public void setAckRecv(int index)
setAckRecv
set that an acknowledgement has been
received at specified index
.
index
- index of the Disseminatable
to mark as ack'd.public boolean getAcksRecv(int index)
getAcksRecv
return true if disseminatable at given index
has been received; otherwise, false.
index
- Index of disseminatable to test if ack has been received.
public int getNumAcksRecv()
getNumAcksRecv
returns the number of ack's recv'd.
public boolean receivedAllAcks(double percentRequired)
receivedAllAcks
returns true if all
Disseminatables
have been
ack'd otherwise returns false.
percentRequired
- perecent of acks we will actually
count as being all of the acks.
Disseminatables
have been
ack'd otherwise returns false.public boolean recv(Disseminatable diss)
recv
receives a Disseminatable
(presumably from
the network) and adds it to this bucket.
INVARIANT: The Disseminatable
should be verified
before calling this function.
diss
- the Disseminatable
to add.
Disseminatables
to safely decode.public boolean canDecode()
public boolean testAndSetDecoded()
testAndSetDecoded
atomically tests if
successfullyDecoded. If it is false, set it to true
ALERT: Make this synchronized!.
VerifiableBlock
is being decoded,
false otherwise.public void setDecoded(boolean decoded)
setDecoded
sets successfully decoded to specified
decoded
.
ALERT: Make this synchronized!
decoded
- set decoded to true or falsepublic void clear()
clear
frees internal data structures that can be
garbage collected.
public void reset(NodeId node_id, SecureHash node_guid)
clear
frees internal data structures that can be
garbage collected.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |