private void initializeCache() throws ClusterException { cache = Optional.of(new PathChildrenCache(client, getPathPrefix(), true)); try { cache.get().start(PathChildrenCache.StartMode.BUILD_INITIAL_CACHE); } catch (Exception e) { throw ClusterException.create(ClusterException.Type.METASTORE, "Failed to initialize ZooKeeper cache: " + e.getMessage()); } }