Examples of tableOperations()


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

      checkTableExists(connector, tableName);
     
      TreeSet<Integer> constraintNumbers = new TreeSet<Integer>();
      TreeMap<String,Integer> constraintClasses = new TreeMap<String,Integer>();
      int i;
      for (Map.Entry<String,String> property : connector.tableOperations().getProperties(tableName)) {
        if (property.getKey().startsWith(Property.TABLE_CONSTRAINT_PREFIX.toString())) {
          try {
            i = Integer.parseInt(property.getKey().substring(Property.TABLE_CONSTRAINT_PREFIX.toString().length()));
          } catch (NumberFormatException e) {
            throw new org.apache.accumulo.proxy.thrift.AccumuloException("Bad key for existing constraint: " + property.toString());
View Full Code Here

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

      while (constraintNumbers.contains(i))
        i++;
      if (constraintClasses.containsKey(constraintClassName))
        throw new AccumuloException("Constraint " + constraintClassName + " already exists for table " + tableName + " with number "
            + constraintClasses.get(constraintClassName));
      connector.tableOperations().setProperty(tableName, Property.TABLE_CONSTRAINT_PREFIX.toString() + i, constraintClassName);
      return i;
    } catch (Exception e) {
      handleExceptionTNF(e);
      return -1;
    }
View Full Code Here

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

      if (auths != null) {
        auth = getAuthorizations(auths);
      } else {
        auth = connector.securityOperations().getUserAuthorizations(connector.whoami());
      }
      Text max = connector.tableOperations().getMaxRow(tableName, auth, startText, startInclusive, endText, endInclusive);
      return TextUtil.getByteBuffer(max);
    } catch (Exception e) {
      handleExceptionTNF(e);
      return null;
    }
View Full Code Here

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

    try {
      checkTableExists(getConnector(login), tableName);
      Connector connector = getConnector(login);
     
      Map<String,Integer> constraints = new TreeMap<String,Integer>();
      for (Map.Entry<String,String> property : connector.tableOperations().getProperties(tableName)) {
        if (property.getKey().startsWith(Property.TABLE_CONSTRAINT_PREFIX.toString())) {
          if (constraints.containsKey(property.getValue()))
            throw new AccumuloException("Same constraint configured twice: " + property.getKey() + "=" + Property.TABLE_CONSTRAINT_PREFIX
                + constraints.get(property.getValue()) + "=" + property.getKey());
          try {
View Full Code Here

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

  public void multipleStopsIsAllowed() throws Exception {
    MiniAccumuloCluster accumulo = new MiniAccumuloCluster(folder.getRoot(), "superSecret");
    accumulo.start();
   
    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", new PasswordToken("superSecret"));
    conn.tableOperations().create("foo");

    accumulo.stop();
    accumulo.stop();
  }
}
View Full Code Here

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

    System.arraycopy(b2, 0, ball, b1.length + 1, b2.length);

    Instance instance = new MockInstance();
    Connector conn = instance.getConnector("root", new PasswordToken(new byte[0]));

    conn.tableOperations().create(table);
    BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
    Mutation m = new Mutation(ball);
    m.put(new byte[0], new byte[0], new byte[0]);
    bw.addMutation(m);
    bw.close();
View Full Code Here

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

    Scanner scanner = conn.createScanner(table, new Authorizations());
    scanner.addScanIterator(is);

    assertTrue("Client side iterator couldn't find a match when it should have", scanner.iterator().hasNext());

    conn.tableOperations().attachIterator(table, is);
    assertTrue("server side iterator couldn't find a match when it should have", conn.createScanner(table, new Authorizations()).iterator().hasNext());
  }
}
View Full Code Here

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

         
          splits.add(new Text(encodeLong(splitPoint)));
          System.out.printf("added split point 0x%016x  %,12d%n", splitPoint, splitPoint);
        }
       
        connector.tableOperations().create(opts.tableName);
        connector.tableOperations().addSplits(opts.tableName, splits);
       
      } else {
        System.err.println("ERROR : " + opts.mode + " is not a valid operation.");
        System.exit(1);
View Full Code Here

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

          splits.add(new Text(encodeLong(splitPoint)));
          System.out.printf("added split point 0x%016x  %,12d%n", splitPoint, splitPoint);
        }
       
        connector.tableOperations().create(opts.tableName);
        connector.tableOperations().addSplits(opts.tableName, splits);
       
      } else {
        System.err.println("ERROR : " + opts.mode + " is not a valid operation.");
        System.exit(1);
      }
View Full Code Here

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

      tableNames.add(String.format("test_%04d", i));
    }
   
    if (!opts.readonly) {
      for (String table : tableNames)
        connector.tableOperations().create(table);
     
      MultiTableBatchWriter b;
      try {
        b = connector.createMultiTableBatchWriter(bwOpts.getBatchWriterConfig());
      } catch (Exception e) {
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.