Package org.apache.bookkeeper.client
Interface BookieWatcher
-
- All Known Implementing Classes:
BookieWatcherImpl
public interface BookieWatcher
Watch for Bookkeeper cluster status.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<BookieId>
getAllBookies()
BookieAddressResolver
getBookieAddressResolver()
java.util.Set<BookieId>
getBookies()
java.util.Set<BookieId>
getReadOnlyBookies()
boolean
isBookieUnavailable(BookieId id)
Determine if a bookie should be considered unavailable.java.util.List<BookieId>
newEnsemble(int ensembleSize, int writeQuorumSize, int ackQuorumSize, java.util.Map<java.lang.String,byte[]> customMetadata)
Create an ensemble with given ensembleSize and writeQuorumSize.void
quarantineBookie(BookieId bookie)
Quarantine bookie so it will not be preferred to be chosen for new ensembles.void
releaseAllQuarantinedBookies()
Release all quarantined bookies, let it can be chosen for new ensembles.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)
Choose a bookie to replace bookie bookieIdx in existingBookies.
-
-
-
Method Detail
-
getBookies
java.util.Set<BookieId> getBookies() throws BKException
- Throws:
BKException
-
getAllBookies
java.util.Set<BookieId> getAllBookies() throws BKException
- Throws:
BKException
-
getReadOnlyBookies
java.util.Set<BookieId> getReadOnlyBookies() throws BKException
- Throws:
BKException
-
getBookieAddressResolver
BookieAddressResolver getBookieAddressResolver()
-
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 SizewriteQuorumSize
- 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.
-
-