public class RoundRobinDistributionSchedule extends java.lang.Object implements DistributionSchedule
DistributionSchedule that places entries in round-robin
fashion. For ensemble size 3, and quorum size 2, Entry 0 goes to bookie 0 and
1, entry 1 goes to bookie 1 and 2, and entry 2 goes to bookie 2 and 0, and so
on.DistributionSchedule.AckSet, DistributionSchedule.QuorumCoverageSet, DistributionSchedule.WriteSetNULL_WRITE_SET| Constructor and Description |
|---|
RoundRobinDistributionSchedule(int writeQuorumSize,
int ackQuorumSize,
int ensembleSize) |
| Modifier and Type | Method and Description |
|---|---|
DistributionSchedule.AckSet |
getAckSet()
Returns an ackset object, responses should be checked against this.
|
DistributionSchedule.QuorumCoverageSet |
getCoverageSet() |
DistributionSchedule.AckSet |
getEnsembleAckSet()
Returns an ackset object useful to wait for all bookies in the ensemble,
responses should be checked against this.
|
DistributionSchedule.WriteSet |
getEnsembleSet(long entryId)
Return the set of bookies indices to send the messages to the whole ensemble.
|
java.util.BitSet |
getEntriesStripedToTheBookie(int bookieIndex,
long startEntryId,
long lastEntryId)
Get the bitset representing the entries from entry 'startEntryId' to
'lastEntryId', that would be striped to the bookie with index -
bookieIndex.
|
DistributionSchedule.WriteSet |
getWriteSet(long entryId)
Return the set of bookie indices to send the message to.
|
int |
getWriteSetBookieIndex(long entryId,
int writeSetIndex)
Return the WriteSet bookie index for a given and index
in the WriteSet.
|
boolean |
hasEntry(long entryId,
int bookieIndex)
Whether entry presents on given bookie index.
|
(package private) static DistributionSchedule.WriteSet |
writeSetFromValues(java.lang.Integer... values) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetWriteQuorumSizepublic RoundRobinDistributionSchedule(int writeQuorumSize,
int ackQuorumSize,
int ensembleSize)
public DistributionSchedule.WriteSet getWriteSet(long entryId)
DistributionSchedulegetWriteSet in interface DistributionSchedulepublic int getWriteSetBookieIndex(long entryId,
int writeSetIndex)
DistributionSchedulegetWriteSetBookieIndex in interface DistributionSchedulepublic DistributionSchedule.WriteSet getEnsembleSet(long entryId)
DistributionSchedulegetEnsembleSet in interface DistributionScheduleentryId - entry id used to calculate the ensemble.static DistributionSchedule.WriteSet writeSetFromValues(java.lang.Integer... values)
public DistributionSchedule.AckSet getAckSet()
DistributionSchedulegetAckSet in interface DistributionSchedulepublic DistributionSchedule.AckSet getEnsembleAckSet()
DistributionSchedulegetEnsembleAckSet in interface DistributionSchedulepublic DistributionSchedule.QuorumCoverageSet getCoverageSet()
getCoverageSet in interface DistributionSchedulepublic boolean hasEntry(long entryId,
int bookieIndex)
DistributionSchedulehasEntry in interface DistributionScheduleentryId - - entryId to check the presence on given bookie indexbookieIndex - - bookie index on which it need to check the possible presence
of the entrypublic java.util.BitSet getEntriesStripedToTheBookie(int bookieIndex,
long startEntryId,
long lastEntryId)
DistributionSchedulegetEntriesStripedToTheBookie in interface DistributionSchedulebookieIndex - index of the bookie in the ensemble starting with 0startEntryId - starting entryidlastEntryId - last entryidCopyright © 2011–2024 The Apache Software Foundation. All rights reserved.