internal String fixForNamespace(String path, bool isSequential) { if (ensurePathNeeded.get()) { try { CuratorZookeeperClient zookeeperClient = client.getZookeeperClient(); RetryLoop.callWithRetry ( zookeeperClient, CallableUtils.FromFunc <object>(() => { ZKPaths.mkdirs(zookeeperClient.getZooKeeper(), ZKPaths.makePath("/", @namespace), true, client.getAclProvider(), true); return(null); }) ); ensurePathNeeded.set(false); } catch (Exception e) { ThreadUtils.checkInterrupted(e); client.logError("Ensure path threw exception", e); } } return(ZKPaths.fixForNamespace(@namespace, path, isSequential)); }
public void processResult(CuratorFramework client, ICuratorEvent @event) { _service.execute(RunnableUtils.FromFunc(() => { try { _callback.processResult(_client, @event); } catch (Exception e) { ThreadUtils.checkInterrupted(e); var keeperException = e as KeeperException; if (keeperException != null) { _client.validateConnection(_client.codeToState(keeperException)); } _client.logError("Background operation result handling threw exception", e); } })); }
public override Task process(WatchedEvent @event) { if (client != null) { if (actualWatcher != null) { actualWatcher.process(new NamespaceWatchedEvent(client, @event)); } else if (curatorWatcher != null) { try { curatorWatcher.process(new NamespaceWatchedEvent(client, @event)); } catch (Exception e) { ThreadUtils.checkInterrupted(e); client.logError("Watcher exception", e); } } } }
internal void logError(String reason, Exception e) { client.logError(reason, e); }