Package org.apache.bookkeeper.client
Interface DistributionSchedule.WriteSet
-
- Enclosing interface:
- DistributionSchedule
public static interface DistributionSchedule.WriteSetA write set represents the set of bookies to which a request will be written. The set consists of a list of indices which can be used to lookup the bookie in the ensemble.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMissingIndices(int maxIndex)If we want a write set to cover all bookies in an ensemble of size X, then all of the index from 0..X must exist in the write set.booleancontains(int i)Whether the set contains the given index.DistributionSchedule.WriteSetcopy()Make a deep copy of this write set.intget(int i)Get the index at index i.intindexOf(int index)Index of a specified bookie index.voidmoveAndShift(int from, int to)Move an index from one position to another, shifting the other indices accordingly.voidrecycle()Recycle write set object when not in use.intset(int i, int index)Set the index at index i.intsize()The number of indexes in the write set.voidsort()Sort the indices.
-
-
-
Method Detail
-
size
int size()
The number of indexes in the write set.
-
contains
boolean contains(int i)
Whether the set contains the given index.
-
get
int get(int i)
Get the index at index i.
-
set
int set(int i, int index)Set the index at index i.- Returns:
- the previous value at that index.
-
sort
void sort()
Sort the indices.
-
indexOf
int indexOf(int index)
Index of a specified bookie index. -1 if not found.
-
addMissingIndices
void addMissingIndices(int maxIndex)
If we want a write set to cover all bookies in an ensemble of size X, then all of the index from 0..X must exist in the write set. This method appends those which are missing to the end of the write set.
-
moveAndShift
void moveAndShift(int from, int to)Move an index from one position to another, shifting the other indices accordingly.
-
recycle
void recycle()
Recycle write set object when not in use.
-
copy
DistributionSchedule.WriteSet copy()
Make a deep copy of this write set.
-
-