Examples of ZooKeeperInstance


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]);
   
    Instance instance = new ZooKeeperInstance(instanceName, zooKeepers);
   
    String localhost = InetAddress.getLocalHost().getHostName();
    String path = ZooUtil.getRoot(instance) + Constants.ZTRACERS;
    Tracer.getInstance().addReceiver(new ZooSpanClient(zooKeepers, path, localhost, "cwalk", 1000));
    Accumulo.enableTracing(localhost, "ContinuousWalk");
    Connector conn = instance.getConnector(user, password.getBytes());
   
    Random r = new Random();
    RandomAuths randomAuths = new RandomAuths(authsFile);
   
    ArrayList<Value> values = new ArrayList<Value>();
View Full Code Here

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

    accumulo.start();
  }
 
  @Test(timeout = 30000)
  public void test() throws Exception {
    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", "superSecret".getBytes());
   
    conn.tableOperations().create("table1");
   
    conn.securityOperations().createUser("user1", "pass1".getBytes(), 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", "pass1".getBytes());
   
    BatchWriter bw = uconn.createBatchWriter("table1", 10000, 1000000, 2);
   
    UUID uuid = UUID.randomUUID();
   
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.