Interface BookieWatcher

  • All Known Implementing Classes:
    BookieWatcherImpl

    public interface BookieWatcher
    Watch for Bookkeeper cluster status.
    • Method Detail

      • isBookieUnavailable

        boolean isBookieUnavailable​(BookieId id)
        Determine if a bookie should be considered unavailable.
        Parameters:
        id - Bookie to check
        Returns:
        whether or not the given bookie is unavailable
      • newEnsemble

        java.util.List<BookieId> newEnsemble​(int ensembleSize,
                                             int writeQuorumSize,
                                             int ackQuorumSize,
                                             java.util.Map<java.lang.String,​byte[]> customMetadata)
                                      throws BKException.BKNotEnoughBookiesException
        Create an ensemble with given ensembleSize and writeQuorumSize.
        Parameters:
        ensembleSize - Ensemble Size
        writeQuorumSize - Write Quorum Size
        Returns:
        list of bookies for new ensemble.
        Throws:
        BKException.BKNotEnoughBookiesException
      • replaceBookie

        BookieId replaceBookie​(int ensembleSize,
                               int writeQuorumSize,
                               int ackQuorumSize,
                               java.util.Map<java.lang.String,​byte[]> customMetadata,
                               java.util.List<BookieId> existingBookies,
                               int bookieIdx,
                               java.util.Set<BookieId> excludeBookies)
                        throws BKException.BKNotEnoughBookiesException
        Choose a bookie to replace bookie bookieIdx in existingBookies.
        Parameters:
        existingBookies - list of existing bookies.
        bookieIdx - index of the bookie in the list to be replaced.
        Returns:
        the bookie to replace.
        Throws:
        BKException.BKNotEnoughBookiesException
      • quarantineBookie

        void quarantineBookie​(BookieId bookie)
        Quarantine bookie so it will not be preferred to be chosen for new ensembles.
        Parameters:
        bookie -
      • releaseAllQuarantinedBookies

        void releaseAllQuarantinedBookies()
        Release all quarantined bookies, let it can be chosen for new ensembles.