Interface DistributionSchedule.WriteSet

  • Enclosing interface:
    DistributionSchedule

    public static interface DistributionSchedule.WriteSet
    A 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
      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.
      boolean contains​(int i)
      Whether the set contains the given index.
      DistributionSchedule.WriteSet copy()
      Make a deep copy of this write set.
      int get​(int i)
      Get the index at index i.
      int indexOf​(int index)
      Index of a specified bookie index.
      void moveAndShift​(int from, int to)
      Move an index from one position to another, shifting the other indices accordingly.
      void recycle()
      Recycle write set object when not in use.
      int set​(int i, int index)
      Set the index at index i.
      int size()
      The number of indexes in the write set.
      void sort()
      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.