Package org.apache.accumulo.core.client

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


    opts.addSplits(Constants.METADATA_TABLE_NAME, splits);
  }
 
  @Test(timeout = 60000)
  public void testMetaSplit() throws Exception {
    Instance instance = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers());
    Connector connector = instance.getConnector("root", new PasswordToken(secret));
    TableOperations opts = connector.tableOperations();
    for (int i = 1; i <= 10; i++) {
      opts.create("" + i);
    }
    opts.merge(Constants.METADATA_TABLE_NAME, new Text("01"), new Text("02"));
View Full Code Here


    String zookeepers = this.scaleProps.getProperty("ZOOKEEPERS");
    String user = this.scaleProps.getProperty("USER");
    String password = this.scaleProps.getProperty("PASSWORD");
    System.out.println(password);
   
    conn = new ZooKeeperInstance(instanceName, zookeepers).getConnector(user, new PasswordToken(password));
  }
View Full Code Here

    exec("insert c cf cq value", true);
    exec("insert d cf cq value", true);
    Thread thread = new Thread() {
      public void run() {
        try {
          ZooKeeperInstance instance = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers());
          Connector connector = instance.getConnector("root", new PasswordToken(secret));
          Scanner s = connector.createScanner("t", Constants.NO_AUTHS);
          for (@SuppressWarnings("unused")
          Entry<Key,Value> kv : s)
            ;
        } catch (Exception ex) {
View Full Code Here

   
  }
 
  @Test(timeout = 30000)
  public void test() throws Exception {
    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", new PasswordToken("superSecret"));
   
    conn.tableOperations().create("table1");
   
    conn.securityOperations().createLocalUser("user1", new PasswordToken("pass1"));
    conn.securityOperations().changeUserAuthorizations("user1", new Authorizations("A", "B"));
    conn.securityOperations().grantTablePermission("user1", "table1", TablePermission.WRITE);
    conn.securityOperations().grantTablePermission("user1", "table1", TablePermission.READ);
   
    IteratorSetting is = new IteratorSetting(10, SummingCombiner.class);
    SummingCombiner.setEncodingType(is, LongCombiner.Type.STRING);
    SummingCombiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("META", "COUNT")));
   
    conn.tableOperations().attachIterator("table1", is);
   
    Connector uconn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("user1", new PasswordToken("pass1"));
   
    BatchWriter bw = uconn.createBatchWriter("table1", new BatchWriterConfig());
   
    UUID uuid = UUID.randomUUID();
   
View Full Code Here

  }
 
  @Test(timeout = 60000)
  public void testPerTableClasspath() throws Exception {
   
    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", new PasswordToken("superSecret"));
   
    conn.tableOperations().create("table2");
   
    File jarFile = File.createTempFile("iterator", ".jar");
    FileUtils.copyURLToFile(this.getClass().getResource("/FooFilter.jar"), jarFile);
View Full Code Here

  public String rootPath() {
    return getCluster().getConfig().getDir().getAbsolutePath();
  }

  public String getMonitor() throws KeeperException, InterruptedException {
    Instance instance = new ZooKeeperInstance(getCluster().getClientConfig());
    return MonitorUtil.getLocation(instance);
  }
View Full Code Here

  public void testAddVolumes() throws Exception {

    String[] tableNames = getUniqueNames(2);

    // grab this before shutting down cluster
    String uuid = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers()).getInstanceID();

    verifyVolumesUsed(tableNames[0], false, v1, v2);

    Assert.assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
    cluster.stop();
View Full Code Here

  public void testNonConfiguredVolumes() throws Exception {

    String[] tableNames = getUniqueNames(2);

    // grab this before shutting down cluster
    String uuid = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers()).getInstanceID();

    verifyVolumesUsed(tableNames[0], false, v1, v2);

    Assert.assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
    cluster.stop();
View Full Code Here

    conn.tableOperations().compact(tableNames[0], null, null, true, true);

    verifyVolumesUsed(tableNames[0], true, v2);

    // check that root tablet is not on volume 1
    String zpath = ZooUtil.getRoot(new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers())) + RootTable.ZROOT_TABLET_PATH;
    ZooKeeper zookeeper = new ZooKeeper(cluster.getZooKeepers(), 30000, null);
    String rootTabletDir = new String(zookeeper.getData(zpath, false, null), Constants.UTF8);
    Assert.assertTrue(rootTabletDir.startsWith(v2.toString()));
    zookeeper.close();
View Full Code Here

    verifyVolumesUsed(tableNames[0], true, v8, v9);
    verifyVolumesUsed(tableNames[1], true, v8, v9);

    // check that root tablet is not on volume 1 or 2
    String zpath = ZooUtil.getRoot(new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers())) + RootTable.ZROOT_TABLET_PATH;
    ZooKeeper zookeeper = new ZooKeeper(cluster.getZooKeepers(), 30000, null);
    String rootTabletDir = new String(zookeeper.getData(zpath, false, null), Constants.UTF8);
    Assert.assertTrue(rootTabletDir.startsWith(v8.toString()) || rootTabletDir.startsWith(v9.toString()));
    zookeeper.close();
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.