@Override
    public String getClusterInstanceId() throws BookieException {
        try {
            return store.get(ledgersRootPath + "/" + INSTANCEID)
                    .get(BLOCKING_CALL_TIMEOUT, MILLISECONDS)
                    .map(res -> new String(res.getValue(), UTF_8))
                    .orElseThrow(
                            () -> new BookieException.MetadataStoreException("BookKeeper cluster not initialized"));
        } catch (ExecutionException | InterruptedException | TimeoutException e) {
            throw new BookieException.MetadataStoreException("Failed to get cluster instance id", e);
        }
    }
@Test(dataProvider = "impl")
    public void testGetClusterInstanceIdIfClusterNotInitialized(String provider, Supplier<String> urlSupplier)
            throws Exception {
        methodSetup(urlSupplier);
        try {
            registrationManager.getClusterInstanceId();
            fail("Should fail getting cluster instance id if cluster not initialized");
        } catch (BookieException.MetadataStoreException e) {
            assertTrue(e.getMessage().contains("BookKeeper cluster not initialized"));
        }
    }