public interface DistributionSchedule
Every entry gets replicated to some number of replicas. The first replica for
an entry is given a replicaIndex of 0, and so on. To distribute write load,
not all entries go to all bookies. Given an entry-id and replica index, an
DistributionSchedule
determines which bookie that replica should go
to.
Modifier and Type | Interface and Description |
---|---|
static interface |
DistributionSchedule.AckSet
An ack set represents the set of bookies from which
a response must be received so that an entry can be
considered to be replicated on a quorum.
|
static interface |
DistributionSchedule.QuorumCoverageSet
Interface to keep track of which bookies in an ensemble, an action
has been performed for.
|
static interface |
DistributionSchedule.WriteSet
A write set represents the set of bookies to which
a request will be written.
|
Modifier and Type | Field and Description |
---|---|
static DistributionSchedule.WriteSet |
NULL_WRITE_SET |
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.
|
boolean |
hasEntry(long entryId,
int bookieIndex)
Whether entry presents on given bookie index.
|
static final DistributionSchedule.WriteSet NULL_WRITE_SET
DistributionSchedule.WriteSet getWriteSet(long entryId)
DistributionSchedule.WriteSet getEnsembleSet(long entryId)
entryId
- entry id used to calculate the ensemble.DistributionSchedule.AckSet getAckSet()
DistributionSchedule.AckSet getEnsembleAckSet()
DistributionSchedule.QuorumCoverageSet getCoverageSet()
boolean hasEntry(long entryId, int bookieIndex)
entryId
- - entryId to check the presence on given bookie indexbookieIndex
- - bookie index on which it need to check the possible presence
of the entryjava.util.BitSet getEntriesStripedToTheBookie(int bookieIndex, long startEntryId, long lastEntryId)
bookieIndex
- index of the bookie in the ensemble starting with 0startEntryId
- starting entryidlastEntryId
- last entryidCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.