Package org.apache.accumulo.core.client.admin

Examples of org.apache.accumulo.core.client.admin.TableOperations.create()


    try {
      final String table1 = "testTableRenameNewWriters_table1", table2 = "testTableRenameNewWriters_table2";
      final String newTable1 = "testTableRenameNewWriters_newTable1", newTable2 = "testTableRenameNewWriters_newTable2";

      TableOperations tops = connector.tableOperations();
      tops.create(table1);
      tops.create(table2);

      BatchWriter bw1 = mtbw.getBatchWriter(table1), bw2 = mtbw.getBatchWriter(table2);

      Mutation m1 = new Mutation("foo");
View Full Code Here


      final String table1 = "testTableRenameNewWriters_table1", table2 = "testTableRenameNewWriters_table2";
      final String newTable1 = "testTableRenameNewWriters_newTable1", newTable2 = "testTableRenameNewWriters_newTable2";

      TableOperations tops = connector.tableOperations();
      tops.create(table1);
      tops.create(table2);

      BatchWriter bw1 = mtbw.getBatchWriter(table1), bw2 = mtbw.getBatchWriter(table2);

      Mutation m1 = new Mutation("foo");
      m1.put("col1", "", "val1");
View Full Code Here

    config.setNumTservers(NUM_TSERVERS);
    accumulo = new MiniAccumuloClusterImpl(config);
    accumulo.start();
    // create a table to ensure there are some entries in the !0 table
    TableOperations tableops = accumulo.getConnector("root","superSecret").tableOperations();
    tableops.create(TEST_TABLE);
    testTableID = tableops.tableIdMap().get(TEST_TABLE);

    Scanner s = accumulo.getConnector("root", "superSecret").createScanner(TEST_TABLE, Authorizations.EMPTY);
    for (@SuppressWarnings("unused") Entry<Key,Value> e : s) {}
  }
View Full Code Here

    log.info("Starting bulk test on " + tableName);
   
    TableOperations tableOps = state.getConnector().tableOperations();
    try {
      if (!tableOps.exists(getTableName())) {
        tableOps.create(getTableName());
        IteratorSetting is = new IteratorSetting(10, org.apache.accumulo.core.iterators.user.SummingCombiner.class);
        SummingCombiner.setEncodingType(is, LongCombiner.Type.STRING);
        SummingCombiner.setCombineAllColumns(is, true);
        tableOps.attachIterator(getTableName(), is);
      }
View Full Code Here

    ImportTestFilesAndData dataAndFiles = prepareTestFiles();
    Instance instance = new MockInstance("foo");
    Connector connector = instance.getConnector(new AuthInfo("user", ByteBuffer
        .wrap(new byte[0]), "foo"));
    TableOperations tableOperations = connector.tableOperations();
    tableOperations.create("a_table");
    tableOperations.importDirectory("a_table",
        dataAndFiles.importPath.toString(),
        dataAndFiles.failurePath.toString(), false);
    Scanner scanner = connector.createScanner("a_table", new Authorizations());
    Iterator<Entry<Key, Value>> iterator = scanner.iterator();
View Full Code Here

  public void testImport() throws Throwable {
    ImportTestFilesAndData dataAndFiles = prepareTestFiles();
    Instance instance = new MockInstance("foo");
    Connector connector = instance.getConnector("user", new PasswordToken(new byte[0]));
    TableOperations tableOperations = connector.tableOperations();
    tableOperations.create("a_table");
    tableOperations.importDirectory("a_table", dataAndFiles.importPath.toString(), dataAndFiles.failurePath.toString(), false);
    Scanner scanner = connector.createScanner("a_table", new Authorizations());
    Iterator<Entry<Key,Value>> iterator = scanner.iterator();
    for (int i = 0; i < 5; i++) {
      Assert.assertTrue(iterator.hasNext());
View Full Code Here

  @Test
  public void testDeleteRows() throws Exception {
    Instance instance = new MockInstance("rows");
    Connector connector = instance.getConnector("user", new PasswordToken("foo".getBytes()));
    TableOperations to = connector.tableOperations();
    to.create("test");
    BatchWriter bw = connector.createBatchWriter("test", new BatchWriterConfig());
    for (int r = 0; r < 20; r++) {
      Mutation m = new Mutation("" + r);
      for (int c = 0; c < 5; c++) {
        m.put(new Text("cf"), new Text("" + c), new Value(("" + c).getBytes()));
View Full Code Here

                accumuloCluster.getZooKeepers());
        Connector c = inst.getConnector("root", new PasswordToken("password"));

        TableOperations tops = c.tableOperations();
        if (!tops.exists("airports")) {
            tops.create("airports");
        }

        if (!tops.exists("flights")) {
            tops.create("flights");
        }
View Full Code Here

        if (!tops.exists("airports")) {
            tops.create("airports");
        }

        if (!tops.exists("flights")) {
            tops.create("flights");
        }

        BatchWriterConfig config = new BatchWriterConfig();
        config.setMaxWriteThreads(1);
        config.setMaxLatency(100000l, TimeUnit.MILLISECONDS);
View Full Code Here

                accumuloCluster.getZooKeepers());
        Connector c = inst.getConnector("root", new PasswordToken("password"));

        TableOperations tops = c.tableOperations();
        if (!tops.exists("airports")) {
            tops.create("airports");
        }

        if (!tops.exists("flights")) {
            tops.create("flights");
        }
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.