Package org.apache.bookkeeper.meta
Class NullMetadataBookieDriver.NullRegistrationManager
- java.lang.Object
- 
- org.apache.bookkeeper.meta.NullMetadataBookieDriver.NullRegistrationManager
 
- 
- All Implemented Interfaces:
- java.lang.AutoCloseable,- RegistrationManager
 - Enclosing class:
- NullMetadataBookieDriver
 
 public static class NullMetadataBookieDriver.NullRegistrationManager extends java.lang.Object implements RegistrationManager A no-op implementation of RegistrationManager.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.bookkeeper.discover.RegistrationManagerRegistrationManager.RegistrationListener
 
- 
 - 
Constructor SummaryConstructors Constructor Description NullRegistrationManager()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRegistrationListener(RegistrationManager.RegistrationListener listener)Add a listener to be triggered when an registration event occurs.voidclose()booleanformat()Do format boolean.java.lang.StringgetClusterInstanceId()Return the cluster instance id.booleaninitNewCluster()Initializes new cluster by creating required znodes for the cluster.booleanisBookieRegistered(BookieId bookieId)Checks if Bookie with the given BookieId is registered as readwrite or readonly bookie.booleannukeExistingCluster()Nukes existing cluster metadata.booleanprepareFormat()Prepare ledgers root node, availableNode, readonly node..Versioned<byte[]>readCookie(BookieId bookieId)Read the cookie data, which will be used for verifying the integrity of the bookie environment.voidregisterBookie(BookieId bookieId, boolean readOnly, BookieServiceInfo bookieService)Registering the bookie server as bookieId.voidremoveCookie(BookieId bookieId, Version version)Remove the cookie data.voidunregisterBookie(BookieId bookieId, boolean readOnly)Unregistering the bookie server as bookieId.voidwriteCookie(BookieId bookieId, Versioned<byte[]> cookieData)Write the cookie data, which will be used for verifying the integrity of the bookie environment.
 
- 
- 
- 
Method Detail- 
closepublic void close() - Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- RegistrationManager
 
 - 
getClusterInstanceIdpublic java.lang.String getClusterInstanceId() Description copied from interface:RegistrationManagerReturn the cluster instance id.- Specified by:
- getClusterInstanceIdin interface- RegistrationManager
- Returns:
- the cluster instance id.
 
 - 
registerBookiepublic void registerBookie(BookieId bookieId, boolean readOnly, BookieServiceInfo bookieService) Description copied from interface:RegistrationManagerRegistering the bookie server as bookieId.- Specified by:
- registerBookiein interface- RegistrationManager
- Parameters:
- bookieId- bookie id
- readOnly- whether to register it as writable or readonly
- bookieService- information about services exposed by the Bookie
 
 - 
unregisterBookiepublic void unregisterBookie(BookieId bookieId, boolean readOnly) Description copied from interface:RegistrationManagerUnregistering the bookie server as bookieId.- Specified by:
- unregisterBookiein interface- RegistrationManager
- Parameters:
- bookieId- bookie id
- readOnly- whether to register it as writable or readonly
 
 - 
isBookieRegisteredpublic boolean isBookieRegistered(BookieId bookieId) Description copied from interface:RegistrationManagerChecks if Bookie with the given BookieId is registered as readwrite or readonly bookie.- Specified by:
- isBookieRegisteredin interface- RegistrationManager
- Parameters:
- bookieId- bookie id
- Returns:
- returns true if a bookie with bookieid is currently registered as readwrite or readonly bookie.
 
 - 
writeCookiepublic void writeCookie(BookieId bookieId, Versioned<byte[]> cookieData) throws BookieException Description copied from interface:RegistrationManagerWrite the cookie data, which will be used for verifying the integrity of the bookie environment.- Specified by:
- writeCookiein interface- RegistrationManager
- Parameters:
- bookieId- bookie id
- cookieData- cookie data
- Throws:
- BookieException- when fail to write cookie
 
 - 
readCookiepublic Versioned<byte[]> readCookie(BookieId bookieId) throws BookieException Description copied from interface:RegistrationManagerRead the cookie data, which will be used for verifying the integrity of the bookie environment.- Specified by:
- readCookiein interface- RegistrationManager
- Parameters:
- bookieId- bookie id
- Returns:
- versioned cookie data
- Throws:
- BookieException- when fail to read cookie
 
 - 
removeCookiepublic void removeCookie(BookieId bookieId, Version version) Description copied from interface:RegistrationManagerRemove the cookie data.- Specified by:
- removeCookiein interface- RegistrationManager
- Parameters:
- bookieId- bookie id
- version- version of the cookie data
 
 - 
prepareFormatpublic boolean prepareFormat() Description copied from interface:RegistrationManagerPrepare ledgers root node, availableNode, readonly node..- Specified by:
- prepareFormatin interface- RegistrationManager
- Returns:
- Returns true if old data exists, false if not.
 
 - 
initNewClusterpublic boolean initNewCluster() Description copied from interface:RegistrationManagerInitializes new cluster by creating required znodes for the cluster. If ledgersrootpath is already existing then it will error out.- Specified by:
- initNewClusterin interface- RegistrationManager
- Returns:
- returns true if new cluster is successfully created or false if it failed to initialize.
 
 - 
formatpublic boolean format() Description copied from interface:RegistrationManagerDo format boolean.- Specified by:
- formatin interface- RegistrationManager
- Returns:
- Returns true if success do format, false if not.
 
 - 
nukeExistingClusterpublic boolean nukeExistingCluster() Description copied from interface:RegistrationManagerNukes existing cluster metadata.- Specified by:
- nukeExistingClusterin interface- RegistrationManager
- Returns:
- returns true if cluster metadata is successfully nuked or false if it failed to nuke the cluster metadata.
 
 - 
addRegistrationListenerpublic void addRegistrationListener(RegistrationManager.RegistrationListener listener) Description copied from interface:RegistrationManagerAdd a listener to be triggered when an registration event occurs.- Specified by:
- addRegistrationListenerin interface- RegistrationManager
- Parameters:
- listener- the listener to be added
 
 
- 
 
-