@Override public void onFailure(Throwable cause) { createPromise.setException(cause); } });
@Override public void onFailure(Throwable cause) { fetchPromise.setException(cause); } });
@Override public void onFailure(Throwable cause) { promise.setException(cause); } };
@Override public void onFailure(Throwable cause) { promise.setException(cause); } });
@Override public void onFailure(Throwable cause) { if (cause instanceof KeeperException.NoNodeException) { logger.info("Default Access Control is missing, creating one for {} ...", zkRootPath); createDefaultAccessControlEntryIfNeeded(promise); } else { promise.setException(cause); } } });
@Override void fail(SocketAddress address, Throwable t) { super.fail(address, t); result.setException(t); }
@Override public void onFailure(Throwable cause) { statsLogger.registerFailedEvent(stopwatch.stop().elapsed(TimeUnit.MICROSECONDS)); promise.setException(cause); } });
@Override public void onFailure(Throwable cause) { forceGetListStat.registerFailedEvent(stopwatch.stop().elapsed(TimeUnit.MICROSECONDS)); promise.setException(cause); } });
@Override public void readLastConfirmedAndEntryComplete(int rc, long lac, LedgerEntry ledgerEntry, Object ctx) { if (BKException.Code.OK == rc) { promise.setValue(Pair.of(lac, ledgerEntry)); } else { promise.setException(BKException.create(rc)); } } }, null);
Future<List<String>> getLogSegmentNames(String logSegmentsPath, Watcher watcher) { Promise<List<String>> result = new Promise<List<String>>(); try { zkc.get().getChildren(logSegmentsPath, watcher, this, result); } catch (ZooKeeperClient.ZooKeeperConnectionException e) { result.setException(FutureUtils.zkException(e, logSegmentsPath)); } catch (InterruptedException e) { result.setException(FutureUtils.zkException(e, logSegmentsPath)); } return result; }
@Override public void onSuccess(List<LogSegmentMetadata> value) { try { promise.setValue(getCachedLogSegments(comparator)); } catch (UnexpectedException e) { promise.setException(e); } }
@Override public void closeComplete(int rc, LedgerHandle ledgerHandle, Object ctx) { if (BKException.Code.OK == rc) { promise.setValue(null); } else { promise.setException(BKException.create(rc)); } } }, null);
@Override public void readLastConfirmedComplete(int rc, long lastAddConfirmed, Object ctx) { if (BKException.Code.OK == rc) { promise.setValue(lastAddConfirmed); } else { promise.setException(BKException.create(rc)); } } }, null);
@Override public void readComplete(int rc, LedgerHandle lh, Enumeration<LedgerEntry> entries, Object ctx) { if (BKException.Code.OK == rc) { promise.setValue(entries); } else { promise.setException(BKException.create(rc)); } } }, null);
@Override public void processResult(int rc, String path, Object ctx, String name) { if (KeeperException.Code.OK.intValue() == rc) { logger.info("Created zk path {} for default ACL.", zkRootPath); fetchDefaultAccessControlEntry(promise); } else { promise.setException(KeeperException.create(KeeperException.Code.get(rc))); } } }, null);
@Override public void processResult(int rc, String path, Object ctx) { if (Code.OK.intValue() == rc) { fetchSubNamespaces(watcher, promise); } else { promise.setException(KeeperException.create(Code.get(rc))); } } }, null);
@Override public void processResult(int rc, String path, Object ctx, Stat stat) { if (Code.OK.intValue() == rc) { fetchPromise.setValue(Optional.of(uri)); } else if (Code.NONODE.intValue() == rc) { fetchPromise.setValue(Optional.<URI>absent()); } else { fetchPromise.setException(KeeperException.create(Code.get(rc))); } } }, null);
@Override @SuppressWarnings("unchecked") public void processResult(int rc, String path, Object ctx, List<String> children, Stat stat) { Promise<List<String>> result = ((Promise<List<String>>) ctx); if (KeeperException.Code.OK.intValue() == rc) { result.setValue(children); } else { result.setException(KeeperException.create(KeeperException.Code.get(rc))); } }
@Override public void operationComplete(int rc, List<LogSegmentMetadata> segments) { if (KeeperException.Code.OK.intValue() == rc) { promise.setValue(segments); } else if (KeeperException.Code.NONODE.intValue() == rc) { promise.setException(new LogNotFoundException("Log " + getFullyQualifiedName() + " not found")); } else { String errMsg = "ZK Exception " + rc + " reading ledger list for " + getFullyQualifiedName(); promise.setException(new ZKException(errMsg, KeeperException.Code.get(rc))); } } });
@Override public void processResult(int rc, String path, Object ctx, Stat stat) { if (KeeperException.Code.OK.intValue() == rc) { ZKAccessControl.this.zkVersion = stat.getVersion(); promise.setValue(ZKAccessControl.this); } else { promise.setException(KeeperException.create(KeeperException.Code.get(rc))); } } }, null);