Package org.apache.accumulo.core.client

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


     
      job.setReducerClass(ReduceClass.class);
      job.setOutputFormatClass(AccumuloFileOutputFormat.class);
      AccumuloFileOutputFormat.setZooKeeperInstance(job, args[0], args[1]);
     
      Instance instance = new ZooKeeperInstance(args[0], args[1]);
      String user = args[2];
      byte[] pass = args[3].getBytes();
      String tableName = args[4];
      String inputDir = args[5];
      String workDir = args[6];
     
      Connector connector = instance.getConnector(user, pass);
     
      TextInputFormat.setInputPaths(job, new Path(inputDir));
      AccumuloFileOutputFormat.setOutputPath(job, new Path(workDir + "/files"));
     
      FileSystem fs = FileSystem.get(conf);
View Full Code Here


 
  protected static Instance getInstance(JobContext job) {
    Configuration conf = job.getConfiguration();
    if (conf.getBoolean(MOCK, false))
      return new MockInstance(conf.get(INSTANCE_NAME));
    return new ZooKeeperInstance(conf.get(INSTANCE_NAME), conf.get(ZOOKEEPERS));
  }
View Full Code Here

      instance = new MockInstance();
    } else if (cl.hasOption(hdfsZooInstance.getOpt())) {
      instance = HdfsZooInstance.getInstance();
    } else if (cl.hasOption(zooKeeperInstance.getOpt())) {
      String[] zkOpts = cl.getOptionValues(zooKeeperInstance.getOpt());
      instance = new ZooKeeperInstance(zkOpts[0], zkOpts[1]);
    } else {
      instance = HdfsZooInstance.getInstance();
    }
   
    // process default parameters if unspecified
View Full Code Here

    String keepers = args[i++];
    String username = args[i++];
    String passwd = args[i++];
    String tablename = args[i++];
    int timeout = (int) DefaultConfiguration.getInstance().getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT);
    Instance inst = new ZooKeeperInstance(instance, keepers, timeout);
    Connector conn = inst.getConnector(username, passwd.getBytes());
    Scanner scanner = conn.createScanner(tablename, conn.securityOperations().getUserAuthorizations(username));
    scanner.fetchColumnFamily(BulkPlusOne.CHECK_COLUMN_FAMILY);
    Text startBadRow = null;
    Text lastBadRow = null;
    Value currentBadValue = null;
View Full Code Here

    log.info("Content query: " + query);
    Connector connector = null;
    if (null == instanceName || null == zooKeepers || null == username || null == password)
      throw new EJBException("Required parameters not set. [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = "
          + this.username + ", password = " + this.password + "]. Check values in ejb-jar.xml");
    Instance instance = new ZooKeeperInstance(this.instanceName, this.zooKeepers);
    try {
      log.info("Connecting to [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = " + this.username + ", password = "
          + this.password + "].");
      connector = instance.getConnector(this.username, this.password.getBytes());
    } catch (Exception e) {
      throw new EJBException("Error getting connector from instance", e);
    }
   
    // Create list of auths
View Full Code Here

   
    Connector connector = null;
    if (null == instanceName || null == zooKeepers || null == username || null == password)
      throw new EJBException("Required parameters not set. [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = "
          + this.username + ", password = " + this.password + "]. Check values in ejb-jar.xml");
    Instance instance = new ZooKeeperInstance(this.instanceName, this.zooKeepers);
    try {
      log.info("Connecting to [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = " + this.username + ", password = "
          + this.password + "].");
      connector = instance.getConnector(this.username, this.password.getBytes());
    } catch (Exception e) {
      throw new EJBException("Error getting connector from instance", e);
    }
   
    // Create list of auths
View Full Code Here

   * @see #setMockInstance(Configuration, String)
   */
  protected static Instance getInstance(Configuration conf) {
    if (conf.getBoolean(MOCK, false))
      return new MockInstance(conf.get(INSTANCE_NAME));
    return new ZooKeeperInstance(conf.get(INSTANCE_NAME), conf.get(ZOOKEEPERS));
  }
View Full Code Here

    String user = parts[0];
    String password = parts[1];
    parts = zooInstance.split("/", 2); // localhost, test
    String zoo = parts[0];
    String instance = parts[1];
    result = new InstanceUserPassword(new ZooKeeperInstance(instance, zoo), user, password);
    return result;
  }
View Full Code Here

      System.err.println("Usage: accumulo.server.util.FindOfflineTablets instance zookeepers");
      System.exit(1);
    }
    String instance = args[0];
    String keepers = args[1];
    Instance zooInst = new ZooKeeperInstance(instance, keepers);
    MetaDataTableScanner scanner = new MetaDataTableScanner(zooInst, SecurityConstants.getSystemCredentials(), new Range());
    LiveTServerSet tservers = new LiveTServerSet(zooInst, new Listener() {
      @Override
      public void update(LiveTServerSet current, Set<TServerInstance> deleted, Set<TServerInstance> added) {
        if (!deleted.isEmpty())
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) throws Exception {
   
    final Connector connector = new ZooKeeperInstance("acu14", "localhost").getConnector(SecurityConstants.getSystemCredentials());
   
    TreeSet<Long> splits = new TreeSet<Long>();
    Random r = new Random(42);
   
    while (splits.size() < 99999) {
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.ZooKeeperInstance

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.