Package org.apache.accumulo.core.client

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


 
  @Test
  public void testUpdate() throws Exception {
    Connector c = new MockConnector("root", new MockInstance());
    c.tableOperations().create("test");
    BatchWriter bw = c.createBatchWriter("test", 1000, 1000l, 1);
   
    for (int i = 0; i < 10; i++) {
      Mutation m = new Mutation("r1");
      m.put("cf1", "cq1", "" + i);
      bw.addMutation(m);
View Full Code Here


        for (String s : SecurityHelper.getAuthsArray()) {
          m.put(new Text(), new Text(), new ColumnVisibility(s), new Value("value".getBytes()));
        }
        BatchWriter writer;
        try {
          writer = conn.createBatchWriter(tableName, 9000l, 0l, 1);
        } catch (TableNotFoundException tnfe) {
          if (tableExists)
            throw new AccumuloException("Table didn't exist when it should have: " + tableName);
          return;
        }
View Full Code Here

    BatchWriter writer = null;
    if (!offline) {
      Connector c;
      try {
        c = instance.getConnector(SecurityConstants.getSystemCredentials());
        writer = c.createBatchWriter(Constants.METADATA_TABLE_NAME, 10000000, 60000l, 3);
      } catch (Exception e) {
        log.error("Unable to create writer to remove file from the !METADATA table", e);
      }
    }
   
View Full Code Here

   
    if (!conn.tableOperations().exists(table)) {
      throw new TableNotFoundException(null, table, "Consult the README and create the table before starting ingest.");
    }

    BatchWriter bw = conn.createBatchWriter(table, maxMemory, maxLatency, maxWriteThreads);
    bw = Trace.wrapAll(bw, new CountSampler(1024));
   
    Random r = new Random();
   
    byte[] ingestInstanceId = UUID.randomUUID().toString().getBytes();
View Full Code Here

   
    // ensure there is no data from previous test
    Assert.assertEquals(0, count);

    Connector conn = instance.getConnector(auth);
    BatchWriter bw = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, 1000, 1000, 1);
    for (String line : metadata) {
      String[] parts = line.split(" ");
      String[] columnParts = parts[1].split(":");
      Mutation m = new Mutation(parts[0]);
      m.put(new Text(columnParts[0]), new Text(columnParts[1]), new Value(parts[2].getBytes()));
View Full Code Here

   
    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();
   
    Mutation m = new Mutation(uuid.toString());
    m.put("META", "SIZE", new ColumnVisibility("A|B"), "8");
View Full Code Here

   
    BatchWriter bw = null;
   
    // Add some data
    try {
      bw = c.createBatchWriter(table, 1000l, 100l, 1);
      Mutation m = new Mutation("a");
      for (int i = 0; i < 50; i++) {
        m.put("colf", Integer.toString(i), "");
      }
     
View Full Code Here

  }
 
  public static void cloneTable(Instance instance, String srcTableId, String tableId) throws Exception {
   
    Connector conn = instance.getConnector(SecurityConstants.getSystemCredentials());
    BatchWriter bw = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, 10000000, 60000l, 1);
   
    while (true) {
     
      try {
        initializeClone(srcTableId, tableId, conn, bw);
View Full Code Here

            }
          }
        }
        MetadataTable.addDeleteEntries(range, datafiles, SecurityConstants.getSystemCredentials());
       
        BatchWriter bw = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, 1000000l, 100l, 1);
        try {
          deleteTablets(deleteRange, bw, conn);
        } finally {
          bw.close();
        }
View Full Code Here

          bw.close();
        }

        if (followingTablet != null) {
          log.debug("Updating prevRow of " + followingTablet + " to " + range.getPrevEndRow());
          bw = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, 1000l, 100l, 1);
          try {
            Mutation m = new Mutation(followingTablet.getMetadataEntry());
            ColumnFQ.put(m, Constants.METADATA_PREV_ROW_COLUMN, KeyExtent.encodePrevEndRow(range.getPrevEndRow()));
            ColumnFQ.putDelete(m, Constants.METADATA_CHOPPED_COLUMN);
            bw.addMutation(m);
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.