Package org.apache.accumulo.fate.zookeeper

Examples of org.apache.accumulo.fate.zookeeper.ZooReader


    createTable(opts);
   
    Instance instance = opts.getInstance();
   
    String name = TestIngest.class.getSimpleName();
    DistributedTrace.enable(instance, new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()), name, null);
   
    try {
      opts.startTracing(name);
     
      Logger.getLogger(TabletServerBatchWriter.class.getName()).setLevel(Level.TRACE);
View Full Code Here


        this.token = Class.forName(cl.getOptionValue(tokenOption.getOpt())).asSubclass(AuthenticationToken.class).newInstance();
        this.token.init(props);
      }
     
      if (!cl.hasOption(fakeOption.getLongOpt())) {
        DistributedTrace.enable(instance, new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()), "shell", InetAddress.getLocalHost()
            .getHostName());
      }
     
      Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
View Full Code Here

    if (opts.keepers == null) {
      opts.keepers = ServerConfiguration.getSiteConfiguration().get(Property.INSTANCE_ZK_HOST);
    }
   
    System.out.println("INFO : Using ZooKeepers " + opts.keepers);
    ZooReader rdr = new ZooReader(opts.keepers, ZOOKEEPER_TIMER_MILLIS);
    ZooCache cache = new ZooCache(opts.keepers, ZOOKEEPER_TIMER_MILLIS);

    TreeMap<String,UUID> instanceNames = getInstanceNames(rdr);
   
    System.out.println();
View Full Code Here

public class StopTabletServer extends Test {
 
  Set<TServerInstance> getTServers(Instance instance) throws KeeperException, InterruptedException {
    Set<TServerInstance> result = new HashSet<TServerInstance>();
    ZooReader rdr = new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
    String base = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
    for (String child : rdr.getChildren(base)) {
      try {
        List<String> children = rdr.getChildren(base + "/" + child);
        if (children.size() > 0) {
          Collections.sort(children);
          Stat stat = new Stat();
          byte[] data = rdr.getData(base + "/" + child + "/" + children.get(0), stat);
          if (!"master".equals(new String(data, Constants.UTF8))) {
            result.add(new TServerInstance(AddressUtil.parseAddress(child, Property.TSERV_CLIENTPORT), stat.getEphemeralOwner()));
          }
        }
      } catch (KeeperException.NoNodeException ex) {
View Full Code Here

      auths = new Authorizations();
    }
  }

  public void enableTracing(Opts opts) throws Exception {
    DistributedTrace.enable(opts.getInstance(), new ZooReader(opts.getInstance().getZooKeepers(), 1000), "myHost", "myApp");
  }
View Full Code Here

      throw new RuntimeException(ex);
    }
  }
 
  private static boolean verifyAccumuloIsDown(Instance inst, String oldPassword) {
    ZooReader zooReader = new ZooReaderWriter(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), oldPassword);
    String root = ZooUtil.getRoot(inst);
    final List<String> ephemerals = new ArrayList<String>();
    recurse(zooReader, root, new Visitor() {
      public void visit(ZooReader zoo, String path) throws Exception {
        Stat stat = zoo.getStatus(path);
View Full Code Here

    createTable(opts);
   
    Instance instance = opts.getInstance();
   
    String name = TestIngest.class.getSimpleName();
    DistributedTrace.enable(instance, new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()), name, null);
   
    try {
      opts.startTracing(name);
     
      Logger.getLogger(TabletServerBatchWriter.class.getName()).setLevel(Level.TRACE);
View Full Code Here

      throw new RuntimeException(ex);
    }
  }
 
  private static boolean verifyAccumuloIsDown(Instance inst, String oldPassword) {
    ZooReader zooReader = new ZooReaderWriter(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), oldPassword);
    String root = ZooUtil.getRoot(inst);
    final List<String> ephemerals = new ArrayList<String>();
    recurse(zooReader, root, new Visitor() {
      public void visit(ZooReader zoo, String path) throws Exception {
        Stat stat = zoo.getStatus(path);
View Full Code Here

    opts.parseArgs(VerifyIngest.class.getName(), args, scanOpts);
    Instance instance = opts.getInstance();
    try {
      if (opts.trace) {
        String name = VerifyIngest.class.getSimpleName();
        DistributedTrace.enable(instance, new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()), name, null);
        Trace.on(name);
        Trace.currentTrace().data("cmdLine", Arrays.asList(args).toString());
      }
     
      Connector connector = opts.getConnector();
View Full Code Here

public class StopTabletServer extends Test {
 
  Set<TServerInstance> getTServers(Instance instance) throws KeeperException, InterruptedException {
    Set<TServerInstance> result = new HashSet<TServerInstance>();
    ZooReader rdr = new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
    String base = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
    for (String child : rdr.getChildren(base)) {
      try {
        List<String> children = rdr.getChildren(base + "/" + child);
        if (children.size() > 0) {
          Collections.sort(children);
          Stat stat = new Stat();
          byte[] data = rdr.getData(base + "/" + child + "/" + children.get(0), stat);
          if (!"master".equals(new String(data))) {
            result.add(new TServerInstance(AddressUtil.parseAddress(child, Property.TSERV_CLIENTPORT), stat.getEphemeralOwner()));
          }
        }
      } catch (KeeperException.NoNodeException ex) {
View Full Code Here

TOP

Related Classes of org.apache.accumulo.fate.zookeeper.ZooReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.