Package org.apache.accumulo.core.client

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


      BatchWriter bw = null;
      try {
        long fileCount = 0;
        Connector conn = getConnector();
        // Make file entries in highest tablet
        bw = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, 1000000L, 1000L, 1);
        Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
        scanner.setRange(scanRange);
        ColumnFQ.fetch(scanner, Constants.METADATA_PREV_ROW_COLUMN);
        ColumnFQ.fetch(scanner, Constants.METADATA_TIME_COLUMN);
        ColumnFQ.fetch(scanner, Constants.METADATA_DIRECTORY_COLUMN);
View Full Code Here


 
  public void test() throws IOException, InterruptedException, AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException {
    MockInstance instance = new MockInstance("instance1");
    Connector conn = instance.getConnector("root", "".getBytes());
    conn.tableOperations().create("test");
    BatchWriter bw = conn.createBatchWriter("test", 100000l, 100l, 5);
   
    for (Entry<Key,Value> e : data) {
      Key k = e.getKey();
      Mutation m = new Mutation(k.getRow());
      m.put(k.getColumnFamily(), k.getColumnQualifier(), new ColumnVisibility(k.getColumnVisibility()), k.getTimestamp(), e.getValue());
View Full Code Here

  public void testErrorOnNextWithoutClose() throws IOException, InterruptedException, AccumuloException, AccumuloSecurityException, TableNotFoundException,
      TableExistsException {
    MockInstance instance = new MockInstance("instance2");
    Connector conn = instance.getConnector("root", "".getBytes());
    conn.tableOperations().create("test");
    BatchWriter bw = conn.createBatchWriter("test", 100000l, 100l, 5);
   
    for (Entry<Key,Value> e : data) {
      Key k = e.getKey();
      Mutation m = new Mutation(k.getRow());
      m.put(k.getColumnFamily(), k.getColumnQualifier(), new ColumnVisibility(k.getColumnVisibility()), k.getTimestamp(), e.getValue());
View Full Code Here

  public void testInfoWithoutChunks() throws IOException, InterruptedException, AccumuloException, AccumuloSecurityException, TableNotFoundException,
      TableExistsException {
    MockInstance instance = new MockInstance("instance3");
    Connector conn = instance.getConnector("root", "".getBytes());
    conn.tableOperations().create("test");
    BatchWriter bw = conn.createBatchWriter("test", 100000l, 100l, 5);
    for (Entry<Key,Value> e : baddata) {
      Key k = e.getKey();
      Mutation m = new Mutation(k.getRow());
      m.put(k.getColumnFamily(), k.getColumnQualifier(), new ColumnVisibility(k.getColumnVisibility()), k.getTimestamp(), e.getValue());
      bw.addMutation(m);
View Full Code Here

      r = new Random(Long.parseLong(seed));
    }
   
    ZooKeeperInstance instance = new ZooKeeperInstance(instanceName, zooKeepers);
    Connector connector = instance.getConnector(user, pass);
    BatchWriter bw = connector.createBatchWriter(table, maxMemory, maxLatency, numThreads);
   
    // reuse the ColumnVisibility object to improve performance
    ColumnVisibility cv = new ColumnVisibility(visiblity);
   
    // Generate num unique row ids in the given range
View Full Code Here

    for (String split : splits) {
      splitSet.add(new Text(split));
    }
    conn.tableOperations().addSplits(table, splitSet);
   
    BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
    for (String row : inserts) {
      Mutation m = new Mutation(row);
      m.put("cf", "cq", "v");
      bw.addMutation(m);
    }
View Full Code Here

    conn.tableOperations().addConstraint("foo1", SlowConstraint.class.getName());
   
    // give constraint time to propogate through zookeeper
    UtilWaitThread.sleep(250);
   
    BatchWriter bw = conn.createBatchWriter("foo1", new BatchWriterConfig().setTimeout(3, TimeUnit.SECONDS));
   
    Mutation mut = new Mutation("r1");
    mut.put("cf1", "cq1", "v1");
   
    bw.addMutation(mut);
View Full Code Here

  public void test1() throws Exception {
    MockInstance instance = new MockInstance("rft1");
    Connector conn = instance.getConnector("", new PasswordToken(""));
   
    conn.tableOperations().create("table1");
    BatchWriter bw = conn.createBatchWriter("table1", new BatchWriterConfig());
   
    Mutation m = new Mutation("0");
    m.put("cf1", "cq1", "1");
    m.put("cf1", "cq2", "1");
    m.put("cf1", "cq3", "1");
View Full Code Here

  @Test
  public void test() throws Exception {
    MockInstance inst = new MockInstance();
    Connector conn = inst.getConnector("root", new PasswordToken(""));
    conn.tableOperations().create("test");
    BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig());
    for (String row : "A,B,C,D".split(",")) {
      Mutation m = new Mutation(row);
      m.put("cf", "cq", "");
      bw.addMutation(m);
    }
View Full Code Here

    else {
      r = new Random(opts.seed);
    }
   
    Connector connector = opts.getConnector();
    BatchWriter bw = connector.createBatchWriter(opts.tableName, bwOpts.getBatchWriterConfig());
   
    // reuse the ColumnVisibility object to improve performance
    ColumnVisibility cv = opts.visiblity;
   
    for (int i = 0; i < opts.num; i++) {
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.