Examples of ZooKeeperInstance


Examples of org.apache.accumulo.core.client.ZooKeeperInstance

      System.err.println("Usage: " + FindOfflineTablets.class.getName() + " <instance> <zookeepers>");
      System.exit(1);
    }
    String instance = args[0];
    String keepers = args[1];
    Instance zooInst = new ZooKeeperInstance(instance, keepers);
    MetaDataTableScanner rootScanner = new MetaDataTableScanner(zooInst, SecurityConstants.getSystemCredentials(),
        Constants.ROOT_TABLET_EXTENT.toMetadataRange());
    MetaDataTableScanner metaScanner = new MetaDataTableScanner(zooInst, SecurityConstants.getSystemCredentials(), Constants.NON_ROOT_METADATA_KEYSPACE);
    @SuppressWarnings("unchecked")
    Iterator<TabletLocationState> scanner = (Iterator<TabletLocationState>) new IteratorChain(rootScanner, metaScanner);
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

    Connector conn = null;

    if (scanOffline) {
      Random random = new Random();
      clone = table + "_" + String.format("%016x", Math.abs(random.nextLong()));
      ZooKeeperInstance zki = new ZooKeeperInstance(instance, zookeepers);
      conn = zki.getConnector(user, pass.getBytes());
      conn.tableOperations().clone(table, clone, true, new HashMap<String,String>(), new HashSet<String>());
      ranges = conn.tableOperations().splitRangeByTablets(clone, new Range(), Integer.parseInt(maxMaps));
      conn.tableOperations().offline(clone);
    } else {
      ranges = new ZooKeeperInstance(instance, zookeepers).getConnector(user, pass).tableOperations()
          .splitRangeByTablets(table, new Range(), Integer.parseInt(maxMaps));
    }

    job.setInputFormatClass(AccumuloInputFormat.class);
    Authorizations authorizations;
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

    AccumuloInputFormat.setInputInfo(job.getConfiguration(), user, pass.getBytes(), table, new Authorizations());
    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), instance, zookeepers);
   
    // set up ranges
    try {
      AccumuloInputFormat.setRanges(job.getConfiguration(), new ZooKeeperInstance(instance, zookeepers).getConnector(user, pass.getBytes()).tableOperations()
          .splitRangeByTablets(table, new Range(), Integer.parseInt(maxMaps)));
      AccumuloInputFormat.disableAutoAdjustRanges(job.getConfiguration());
    } catch (Exception e) {
      throw new IOException(e);
    }
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

      String ref = tokens[1];

      undefs.add(new UndefinedNode(undef, ref));
    }

    ZooKeeperInstance zki = new ZooKeeperInstance(instanceName, zooKeepers);
    Connector conn = zki.getConnector(user, password.getBytes());
    BatchScanner bscanner = conn.createBatchScanner(table, Constants.NO_AUTHS, 20);

    List<Range> refs = new ArrayList<Range>();

    for (UndefinedNode undefinedNode : undefs)
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

    boolean checksum = Boolean.parseBoolean(args[13]);
   
    if (min < 0 || max < 0 || max <= min) {
      throw new IllegalArgumentException("bad min and max");
    }
    Instance instance = new ZooKeeperInstance(instanceName, zooKeepers);
    Connector conn = instance.getConnector(user, password);
    String localhost = InetAddress.getLocalHost().getHostName();
    String path = ZooUtil.getRoot(instance) + Constants.ZTRACERS;
    Tracer.getInstance().addReceiver(new ZooSpanClient(zooKeepers, path, localhost, "cingest", 1000));
   
    if (!conn.tableOperations().exists(table)) {
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

    long min = Long.parseLong(args[5]);
    long max = Long.parseLong(args[6]);
   
    long sleepTime = Long.parseLong(args[7]);
   
    Connector conn = new ZooKeeperInstance(instanceName, zooKeepers).getConnector(user, password.getBytes());
    Scanner scanner = ContinuousUtil.createScanner(conn, table, new Authorizations());
   
    Random r = new Random();
   
    while (true) {
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

  private ChunkInputStream cis;
  Scanner scanner;
 
  public FileDataQuery(String instanceName, String zooKeepers, String user, String password, String tableName, Authorizations auths) throws AccumuloException,
      AccumuloSecurityException, TableNotFoundException {
    ZooKeeperInstance instance = new ZooKeeperInstance(instanceName, zooKeepers);
    conn = instance.getConnector(user, password.getBytes());
    lastRefs = new ArrayList<Entry<Key,Value>>();
    cis = new ChunkInputStream();
    scanner = conn.createScanner(tableName, auths);
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

      instance = new MockInstance();
    } else if (cl.hasOption(hdfsZooInstance.getOpt())) {
      instance = getDefaultInstance(AccumuloConfiguration.getSiteConfiguration());
    } else if (cl.hasOption(zooKeeperInstance.getOpt())) {
      String[] zkOpts = cl.getOptionValues(zooKeeperInstance.getOpt());
      instance = new ZooKeeperInstance(zkOpts[0], zkOpts[1]);
    } else {
      instance = getDefaultInstance(AccumuloConfiguration.getSiteConfiguration());
    }

    // process default parameters if unspecified
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

   */
  @Deprecated
  private static Instance getDefaultInstance(AccumuloConfiguration conf) {
    String keepers = conf.get(Property.INSTANCE_ZK_HOST);
    Path instanceDir = new Path(conf.get(Property.INSTANCE_DFS_DIR), "instance_id");
    return new ZooKeeperInstance(UUID.fromString(ZooKeeperInstance.getInstanceIDFromHdfs(instanceDir)), keepers);
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

    if (connector == null) {
      String instance = props.getProperty("INSTANCE");
      String zookeepers = props.getProperty("ZOOKEEPERS");
      String username = props.getProperty("USERNAME");
      String password = props.getProperty("PASSWORD");
      connector = new ZooKeeperInstance(instance, zookeepers).getConnector(username, password.getBytes());
    }
    return connector;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.