Search in sources :

Example 1 with BookieIllegalOpException

use of org.apache.bookkeeper.bookie.BookieException.BookieIllegalOpException in project bookkeeper by apache.

the class Bookie method instantiateMetadataDriver.

/**
 * Instantiate the metadata driver for the Bookie.
 */
private MetadataBookieDriver instantiateMetadataDriver(ServerConfiguration conf) throws BookieException {
    try {
        String metadataServiceUriStr = conf.getMetadataServiceUri();
        if (null == metadataServiceUriStr) {
            return null;
        }
        MetadataBookieDriver driver = MetadataDrivers.getBookieDriver(URI.create(metadataServiceUriStr));
        driver.initialize(conf, () -> {
            stateManager.forceToUnregistered();
            // schedule a re-register operation
            stateManager.registerBookie(false);
        }, statsLogger);
        return driver;
    } catch (MetadataException me) {
        throw new MetadataStoreException("Failed to initialize metadata bookie driver", me);
    } catch (ConfigurationException e) {
        throw new BookieIllegalOpException(e);
    }
}
Also used : MetadataStoreException(org.apache.bookkeeper.bookie.BookieException.MetadataStoreException) ConfigurationException(org.apache.commons.configuration.ConfigurationException) MetadataBookieDriver(org.apache.bookkeeper.meta.MetadataBookieDriver) MetadataException(org.apache.bookkeeper.meta.exceptions.MetadataException) BookieIllegalOpException(org.apache.bookkeeper.bookie.BookieException.BookieIllegalOpException)

Aggregations

BookieIllegalOpException (org.apache.bookkeeper.bookie.BookieException.BookieIllegalOpException)1 MetadataStoreException (org.apache.bookkeeper.bookie.BookieException.MetadataStoreException)1 MetadataBookieDriver (org.apache.bookkeeper.meta.MetadataBookieDriver)1 MetadataException (org.apache.bookkeeper.meta.exceptions.MetadataException)1 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1