/** * Create a new instance. * @param zkStr zookeper connection string * @param sessionTimeout timeout in milliseconds * @param connectionWatcher watcher to set * @param authInfos authorization bytes */ public TephraZKClientService(String zkStr, int sessionTimeout, Watcher connectionWatcher, Multimap<String, byte[]> authInfos) { this.zkStr = zkStr; this.sessionTimeout = sessionTimeout; this.connectionWatchers = new CopyOnWriteArrayList<>(); this.authInfos = copyAuthInfo(authInfos); addConnectionWatcher(connectionWatcher); this.zooKeeper = new AtomicReference<>(); this.stopTask = createStopTask(); }