@Override public String getZooKeepers() { return context.getZooKeepers(); }
protected synchronized IZooReaderWriter getZooReaderWriter(ClientContext context, SiteConfiguration siteConfig, String secret) { if (secret == null) { secret = siteConfig.get(Property.INSTANCE_SECRET); } return new ZooReaderWriter(context.getZooKeepers(), context.getZooKeepersSessionTimeOut(), SCHEME, (USER + ":" + secret).getBytes()); }
/** * Return the cached ZooCache for provided context. ZooCache is initially created with a watcher * that will clear the TableMap cache for that instance when WatchedEvent occurs. */ private static ZooCache getZooCache(final ClientContext context) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(TABLES_PERMISSION); } final String uuid = context.getInstanceID(); try { return instanceToZooCache.get(uuid, () -> { final String zks = context.getZooKeepers(); final int timeOut = context.getZooKeepersSessionTimeOut(); return new ZooCacheFactory().getZooCache(zks, timeOut, watchedEvent -> instanceToMapCache.invalidate(uuid)); }); } catch (ExecutionException e) { throw new RuntimeException(e); } }
public static String getLocation(ClientContext context) throws KeeperException, InterruptedException { return getLocation(new ZooReader(context.getZooKeepers(), 30000), context); }
context.getZooKeepers(), zkPath); ZooReader reader = new ZooReader(context.getZooKeepers(), context.getZooKeepersSessionTimeOut()); replCoordinatorAddr = new String(reader.getData(zkPath, null), UTF_8);