@Override public String getZooKeepers() { return context.getZooKeepers(); }
public ZooArbitrator(ServerContext context) { this.context = context; rdr = new ZooReader(context.getZooKeepers(), context.getZooKeepersSessionTimeOut()); }
private static void deleteInstance(ServerContext context, String oldPass) throws Exception { IZooReaderWriter orig = new ZooReaderWriter(context.getZooKeepers(), context.getZooKeepersSessionTimeOut(), oldPass); orig.recursiveDelete("/accumulo/" + context.getInstanceID(), NodeMissingPolicy.SKIP); } }
@Override public void execute(final String[] args) throws KeeperException, InterruptedException { ServerContext context = new ServerContext(new SiteConfiguration()); System.out.println("monitor: " + MonitorUtil.getLocation(context)); System.out.println("masters: " + context.getMasterLocations()); System.out.println("zookeepers: " + context.getZooKeepers()); }
public MasterReplicationCoordinator(Master master) { this(master, new ZooReader(master.getContext().getZooKeepers(), master.getContext().getZooKeepersSessionTimeOut())); }
osw.append("srcInstanceName:" + context.getInstanceName() + "\n"); osw.append("srcInstanceID:" + context.getInstanceID() + "\n"); osw.append("srcZookeepers:" + context.getZooKeepers() + "\n"); osw.append("srcTableName:" + tableName + "\n"); osw.append("srcTableID:" + tableID.canonicalID() + "\n");
private static void verifyAccumuloIsDown(ServerContext context, String oldPassword) throws Exception { ZooReader zooReader = new ZooReaderWriter(context.getZooKeepers(), context.getZooKeepersSessionTimeOut(), oldPassword); String root = context.getZooKeeperRoot(); final List<String> ephemerals = new ArrayList<>(); recurse(zooReader, root, new Visitor() { @Override public void visit(ZooReader zoo, String path) throws Exception { Stat stat = zoo.getStatus(path); if (stat.getEphemeralOwner() != 0) ephemerals.add(path); } }); if (ephemerals.size() > 0) { System.err.println("The following ephemeral nodes exist, something is still running:"); for (String path : ephemerals) { System.err.println(path); } throw new Exception("Accumulo must be shut down in order to run this tool."); } }
@Override public void execute(final String[] args) throws Exception { Opts opts = new Opts(); opts.parseArgs(ZooKeeperMain.class.getName(), args); try (ServerContext context = new ServerContext(new SiteConfiguration())) { FileSystem fs = context.getVolumeManager().getDefaultVolume().getFileSystem(); String baseDir = ServerConstants.getBaseUris(context)[0]; System.out.println("Using " + fs.makeQualified(new Path(baseDir + "/instance_id")) + " to lookup accumulo instance"); if (opts.servers == null) { opts.servers = context.getZooKeepers(); } System.out.println("The accumulo instance id is " + context.getInstanceID()); if (!opts.servers.contains("/")) opts.servers += "/accumulo/" + context.getInstanceID(); org.apache.zookeeper.ZooKeeperMain .main(new String[] {"-server", opts.servers, "-timeout", "" + (opts.timeout * 1000)}); } } }
private synchronized ZooCachePropertyAccessor getPropCacheAccessor() { if (propCacheAccessor == null) { synchronized (propCaches) { PropCacheKey key = new PropCacheKey(context.getInstanceID(), namespaceId.canonicalID()); ZooCache propCache = propCaches.get(key); if (propCache == null) { propCache = zcf.getZooCache(context.getZooKeepers(), context.getZooKeepersSessionTimeOut(), new NamespaceConfWatcher(context)); propCaches.put(key, propCache); } propCacheAccessor = new ZooCachePropertyAccessor(propCache); } } return propCacheAccessor; }
ListInstances.listInstances(context.getZooKeepers(), listIntancesOpts.printAll, listIntancesOpts.printErrors); } else if (cl.getParsedCommand().equals("ping")) {
private synchronized ZooCachePropertyAccessor getPropCacheAccessor() { if (propCacheAccessor == null) { synchronized (propCaches) { PropCacheKey key = new PropCacheKey(context.getInstanceID(), tableId.canonicalID()); ZooCache propCache = propCaches.get(key); if (propCache == null) { propCache = zcf.getZooCache(context.getZooKeepers(), context.getZooKeepersSessionTimeOut(), new TableConfWatcher(context)); propCaches.put(key, propCache); } propCacheAccessor = new ZooCachePropertyAccessor(propCache); } } return propCacheAccessor; }
private static void rewriteZooKeeperInstance(final ServerContext context, final String newInstanceId, String oldPass, String newPass) throws Exception { final ZooReaderWriter orig = new ZooReaderWriter(context.getZooKeepers(), context.getZooKeepersSessionTimeOut(), oldPass); final IZooReaderWriter new_ = new ZooReaderWriter(context.getZooKeepers(), context.getZooKeepersSessionTimeOut(), newPass);
public void process(WatchedEvent arg0) {} }; propCache = zcf.getZooCache(context.getZooKeepers(), context.getZooKeepersSessionTimeOut(), watcher); config = new ZooConfiguration(context, propCache, parent);