Package org.apache.accumulo.core.client

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


   * Scan 0 |------------------------------| Scan 1 |----------| Minc 1 |-----| Scan 2 |----------| Scan 3 |---------------| Minc 2 |-----| Majc 1 |-----|
   */
 
  @Override
  public void run() throws Exception {
    BatchWriter bw = getConnector().createBatchWriter("cct", new BatchWriterConfig());
    for (int i = 0; i < 50; i++) {
      Mutation m = new Mutation(new Text(String.format("%06d", i)));
      m.put(new Text("cf1"), new Text("cq1"), new Value("foo".getBytes(Constants.UTF8)));
      bw.addMutation(m);
    }
View Full Code Here


        MutationsRejectedException {
      if (!getConnector().tableOperations().exists(TEST_TABLE)) {
        // create the test table
        getConnector().tableOperations().create(TEST_TABLE);
        // put in some initial data
        BatchWriter writer = getConnector().createBatchWriter(TEST_TABLE, new BatchWriterConfig());
        Mutation m = new Mutation(new Text("row"));
        m.put(new Text("cf"), new Text("cq"), new Value("val".getBytes(Constants.UTF8)));
        writer.addMutation(m);
        writer.close();
       
View Full Code Here

              throw se;
          }
          break;
        case WRITE:
          try {
            writer = test_user_conn.createBatchWriter(TEST_TABLE, new BatchWriterConfig());
            m = new Mutation(new Text("row"));
            m.put(new Text("a"), new Text("b"), new Value("c".getBytes(Constants.UTF8)));
            writer.addMutation(m);
            try {
              writer.close();
View Full Code Here

          Iterator<Entry<Key,Value>> iter = scanner.iterator();
          while (iter.hasNext())
            iter.next();
          break;
        case WRITE:
          writer = test_user_conn.createBatchWriter(TEST_TABLE, new BatchWriterConfig());
          m = new Mutation(new Text("row"));
          m.put(new Text("a"), new Text("b"), new Value("c".getBytes(Constants.UTF8)));
          writer.addMutation(m);
          writer.close();
          break;
View Full Code Here

    getConnector().tableOperations().create("tt");
    IteratorSetting is = new IteratorSetting(5, "Bad Aggregator", BadCombiner.class);
    Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("acf")));
    getConnector().tableOperations().attachIterator("tt", is);
   
    BatchWriter bw = getConnector().createBatchWriter("tt", new BatchWriterConfig());
   
    Mutation m = new Mutation(new Text("r1"));
    m.put(new Text("acf"), new Text("foo"), new Value(new byte[] {'1'}));
   
    bw.addMutation(m);
View Full Code Here

    }

  }
 
  private void fillTable(String table) throws Exception {
    BatchWriter bw = getConnector().createBatchWriter(TABLE, new BatchWriterConfig());
    for (String row : ROWS) {
      Mutation m = new Mutation(row);
      m.put("cf", "cq", "value");
      bw.addMutation(m);
    }
View Full Code Here

  @Test
  public void testTableRenameDataValidation() throws Exception {
    ZooKeeperInstance instance = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers());
    Connector connector = instance.getConnector("root", password);

    BatchWriterConfig config = new BatchWriterConfig();

    TCredentials creds = CredentialHelper.create("root", password, instance.getInstanceID());
    MultiTableBatchWriter mtbw = new MultiTableBatchWriterImpl(instance, creds, config, 60, TimeUnit.SECONDS);

    try {
View Full Code Here

  @Test
  public void testTableRenameSameWriters() throws Exception {
    ZooKeeperInstance instance = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers());
    Connector connector = instance.getConnector("root", password);

    BatchWriterConfig config = new BatchWriterConfig();

    TCredentials creds = CredentialHelper.create("root", password, instance.getInstanceID());
    MultiTableBatchWriter mtbw = new MultiTableBatchWriterImpl(instance, creds, config, 60, TimeUnit.SECONDS);

    try {
View Full Code Here

  @Test
  public void testTableRenameNewWriters() throws Exception {
    ZooKeeperInstance instance = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers());
    Connector connector = instance.getConnector("root", password);

    BatchWriterConfig config = new BatchWriterConfig();

    TCredentials creds = CredentialHelper.create("root", password, instance.getInstanceID());
    MultiTableBatchWriter mtbw = new MultiTableBatchWriterImpl(instance, creds, config, 60, TimeUnit.SECONDS);

    try {
View Full Code Here

  @Test
  public void testTableRenameNewWritersNoCaching() throws Exception {
    ZooKeeperInstance instance = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers());
    Connector connector = instance.getConnector("root", password);

    BatchWriterConfig config = new BatchWriterConfig();
   
    TCredentials creds = CredentialHelper.create("root", password, instance.getInstanceID());
    MultiTableBatchWriter mtbw = new MultiTableBatchWriterImpl(instance, creds, config, 0, TimeUnit.SECONDS);

    try {
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.BatchWriterConfig

Copyright © 2018 www.massapicom. 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.