@Override
    public synchronized void setConf(Configuration conf) {
        super.setConf(conf);
        MetadataStore store;
        try {
            store = getMetadataStore(conf);
        } catch (MetadataException e) {
            throw new RuntimeException(METADATA_STORE_INSTANCE + " failed to init BookieId list");
        }

        bookieMappingCache = store.getMetadataCache(BookiesRackConfiguration.class);
        store.registerListener(this::handleUpdates);

        try {
            var racksWithHost = bookieMappingCache.get(BOOKIE_INFO_ROOT_PATH)
                    .thenApply(optRes -> optRes.orElseGet(BookiesRackConfiguration::new))
                    .get();

            for (var bookieMapping : racksWithHost.values()) {
                for (String address : bookieMapping.keySet()) {
                    bookieAddressListLastTime.add(BookieId.parse(address));
                }
                if (LOG.isDebugEnabled()) {
                    LOG.debug("BookieRackAffinityMapping init, bookieAddressListLastTime {}",
                            bookieAddressListLastTime);
                }
            }
            updateRacksWithHost(racksWithHost);
        } catch (ExecutionException | InterruptedException e) {
            LOG.error("Failed to update rack info. ", e);
            throw new RuntimeException(e);
        }

        watchAvailableBookies();
    }
@Test
    public void testMultipleMetadataServiceUris() {
        BookieRackAffinityMapping mapping1 = new BookieRackAffinityMapping();
        ClientConfiguration bkClientConf1 = new ClientConfiguration();
        bkClientConf1.setProperty("metadataServiceUri", "memory:local,memory:local");
        bkClientConf1.setProperty("zkTimeout", "100000");

        mapping1.setBookieAddressResolver(BookieSocketAddress.LEGACY_BOOKIEID_RESOLVER);
        // This previously threw an exception when the metadataServiceUri was a comma delimited list.
        mapping1.setConf(bkClientConf1);
    }