Package org.apache.bookkeeper.client
Interface BookieWatcher
- All Known Implementing Classes:
BookieWatcherImpl
public interface BookieWatcher
Watch for Bookkeeper cluster status.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine if a bookie should be considered unavailable.newEnsemble(int ensembleSize, int writeQuorumSize, int ackQuorumSize, Map<String, byte[]> customMetadata) Create an ensemble with given ensembleSize and writeQuorumSize.voidquarantineBookie(BookieId bookie) Quarantine bookie so it will not be preferred to be chosen for new ensembles.voidRelease all quarantined bookies, let it can be chosen for new ensembles.replaceBookie(int ensembleSize, int writeQuorumSize, int ackQuorumSize, Map<String, byte[]> customMetadata, List<BookieId> existingBookies, int bookieIdx, Set<BookieId> excludeBookies) Choose a bookie to replace bookie bookieIdx in existingBookies.
-
Method Details
-
getBookies
- Throws:
BKException
-
getAllBookies
- Throws:
BKException
-
getReadOnlyBookies
- Throws:
BKException
-
getBookieAddressResolver
BookieAddressResolver getBookieAddressResolver() -
newEnsemble
List<BookieId> newEnsemble(int ensembleSize, int writeQuorumSize, int ackQuorumSize, Map<String, byte[]> customMetadata) throws BKException.BKNotEnoughBookiesExceptionCreate an ensemble with given ensembleSize and writeQuorumSize.- Parameters:
ensembleSize- Ensemble SizewriteQuorumSize- Write Quorum Size- Returns:
- list of bookies for new ensemble.
- Throws:
BKException.BKNotEnoughBookiesException
-
replaceBookie
BookieId replaceBookie(int ensembleSize, int writeQuorumSize, int ackQuorumSize, Map<String, byte[]> customMetadata, List<BookieId> existingBookies, int bookieIdx, Set<BookieId> excludeBookies) throws BKException.BKNotEnoughBookiesExceptionChoose 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
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.
-