public void displayConfig() { try { String value = store.read(ConfigUpdater.CONFIG, this); System.out.printf("取出值 %s from %s\n", ConfigUpdater.CONFIG, value); } catch (KeeperException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } }
public ConfigWatcher(String host) throws IOException, InterruptedException { store = new ActiveKeyValueStore(); store.connect(host); }