Package org.apache.accumulo.core.client

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


  protected Connector getConnector() throws AccumuloException, AccumuloSecurityException {
    return getInstance().getConnector(getPrincipal(), getToken());
  }
 
  protected Instance getInstance() {
    return new ZooKeeperInstance(getInstanceName(), ServerConfiguration.getSiteConfiguration().get(Property.INSTANCE_ZK_HOST));
  }
View Full Code Here


   
    String useMock = props.getProperty("useMockInstance");
    if (useMock != null && Boolean.parseBoolean(useMock))
      instance = new MockInstance();
    else
      instance = new ZooKeeperInstance(props.getProperty("instance"), props.getProperty("zookeepers"));
   
    try {
      String tokenProp = props.getProperty("tokenClass", PasswordToken.class.getName());
      tokenClass = Class.forName(tokenProp).asSubclass(AuthenticationToken.class);
    } catch (ClassNotFoundException e) {
View Full Code Here

 
  public Instance getInstance() {
    if (instance == null) {
      String instance = props.getProperty("INSTANCE");
      String zookeepers = props.getProperty("ZOOKEEPERS");
      this.instance = new ZooKeeperInstance(instance, zookeepers);
    }
    return instance;
  }
View Full Code Here

    if (mock)
      return cachedInstance = new MockInstance(instance);
    if (instance == null) {
      return cachedInstance = HdfsZooInstance.getInstance();
    }
    return cachedInstance = new ZooKeeperInstance(this.instance, this.zookeepers);
  }
View Full Code Here

    if (mock)
      return cachedInstance = new MockInstance(instance);
    if (instance == null) {
      return cachedInstance = HdfsZooInstance.getInstance();
    }
    return cachedInstance = new ZooKeeperInstance(this.instance, this.zookeepers);
  }
View Full Code Here

    if (mock)
      return new MockInstance(instance);
    if (instance == null) {
      return HdfsZooInstance.getInstance();
    }
    return new ZooKeeperInstance(this.instance, this.zookeepers);
  }
View Full Code Here

    TServerUtils.startTServer(opts.port, processor, "NullTServer", "null tserver", 2, 1000, 10*1024*1024);
   
    InetSocketAddress addr = new InetSocketAddress(InetAddress.getLocalHost(), opts.port);
   
    // modify !METADATA
    ZooKeeperInstance zki = new ZooKeeperInstance(opts.iname, opts.keepers);
    String tableId = Tables.getTableId(zki, opts.tableName);
   
    // read the locations for the table
    Range tableRange = new KeyExtent(new Text(tableId), null, null).toMetadataRange();
    MetaDataTableScanner s = new MetaDataTableScanner(zki, SecurityConstants.getSystemCredentials(), tableRange);
View Full Code Here

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

      };
      this.zookeepers = config.get(Property.INSTANCE_ZK_HOST);
      Path instanceDir = new Path(config.get(Property.INSTANCE_DFS_DIR), "instance_id");
      @SuppressWarnings("deprecation")
      String instanceIDFromFile = ZooKeeperInstance.getInstanceIDFromHdfs(instanceDir);
      return cachedInstance = new ZooKeeperInstance(UUID.fromString(instanceIDFromFile), zookeepers);
    }
    return cachedInstance = new ZooKeeperInstance(this.instance, this.zookeepers);
  }
View Full Code Here

  @Test(timeout = 60000)
  public void test() throws Exception {
   
    for (int tn = 0; tn < 2; tn++) {
     
      ZooKeeperInstance instance = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers());
      Connector connector = instance.getConnector("root", new PasswordToken(secret));
      // create a table and put some data in it
      connector.tableOperations().create(TABLE);
      BatchWriter bw = connector.createBatchWriter(TABLE, new BatchWriterConfig());
      bw.addMutation(m("a"));
      bw.addMutation(m("b"));
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.