Examples of tableOperations()


Examples of org.apache.accumulo.core.client.Connector.tableOperations()

  public static void createTable(Opts args) throws Exception {
    if (args.createTable) {
      TreeSet<Text> splits = getSplitPoints(args.startRow, args.startRow + args.rows, args.numsplits);
     
      Connector conn = args.getConnector();
      if (!conn.tableOperations().exists(args.getTableName()))
        conn.tableOperations().create(args.getTableName());
      try {
        conn.tableOperations().addSplits(args.getTableName(), splits);
      } catch (TableNotFoundException ex) {
        // unlikely
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.tableOperations()

    if (args.createTable) {
      TreeSet<Text> splits = getSplitPoints(args.startRow, args.startRow + args.rows, args.numsplits);
     
      Connector conn = args.getConnector();
      if (!conn.tableOperations().exists(args.getTableName()))
        conn.tableOperations().create(args.getTableName());
      try {
        conn.tableOperations().addSplits(args.getTableName(), splits);
      } catch (TableNotFoundException ex) {
        // unlikely
        throw new RuntimeException(ex);
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.tableOperations()

     
      Connector conn = args.getConnector();
      if (!conn.tableOperations().exists(args.getTableName()))
        conn.tableOperations().create(args.getTableName());
      try {
        conn.tableOperations().addSplits(args.getTableName(), splits);
      } catch (TableNotFoundException ex) {
        // unlikely
        throw new RuntimeException(ex);
      }
    }
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.tableOperations()

 
  @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);
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.tableOperations()

   
    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());
   
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.tableOperations()

  @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);
    jarFile.deleteOnExit();
   
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.tableOperations()

    File jarFile = File.createTempFile("iterator", ".jar");
    FileUtils.copyURLToFile(this.getClass().getResource("/FooFilter.jar"), jarFile);
    jarFile.deleteOnExit();
   
    conn.instanceOperations().setProperty(Property.VFS_CONTEXT_CLASSPATH_PROPERTY.getKey() + "cx1", jarFile.toURI().toString());
    conn.tableOperations().setProperty("table2", Property.TABLE_CLASSPATH.getKey(), "cx1");
    conn.tableOperations().attachIterator("table2", new IteratorSetting(100, "foocensor", "org.apache.accumulo.test.FooFilter"));
   
    BatchWriter bw = conn.createBatchWriter("table2", new BatchWriterConfig());
   
    Mutation m1 = new Mutation("foo");
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.tableOperations()

    FileUtils.copyURLToFile(this.getClass().getResource("/FooFilter.jar"), jarFile);
    jarFile.deleteOnExit();
   
    conn.instanceOperations().setProperty(Property.VFS_CONTEXT_CLASSPATH_PROPERTY.getKey() + "cx1", jarFile.toURI().toString());
    conn.tableOperations().setProperty("table2", Property.TABLE_CLASSPATH.getKey(), "cx1");
    conn.tableOperations().attachIterator("table2", new IteratorSetting(100, "foocensor", "org.apache.accumulo.test.FooFilter"));
   
    BatchWriter bw = conn.createBatchWriter("table2", new BatchWriterConfig());
   
    Mutation m1 = new Mutation("foo");
    m1.put("cf1", "cq1", "v2");
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.tableOperations()

    }
   
    Assert.assertEquals(2, count);
   
    conn.instanceOperations().removeProperty(Property.VFS_CONTEXT_CLASSPATH_PROPERTY.getKey() + "cx1");
    conn.tableOperations().delete("table2");
   
  }
 
  @AfterClass
  public static void tearDownMiniCluster() throws Exception {
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.tableOperations()

  public void test() throws Exception {
    ZooKeeperInstance inst = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers());
    Connector c = inst.getConnector("root", new PasswordToken(passwd));
   
    final String table = "foobar";
    c.tableOperations().create(table);
   
    BatchWriter bw = null;
   
    // Add some data
    try {
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.