congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
TableOperations.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
org.apache.accumulo.core.client.admin.TableOperations

Best Java code snippets using org.apache.accumulo.core.client.admin.TableOperations.create (Showing top 20 results out of 450)

Refine searchRefine arrow

  • Connector.tableOperations
  • Test.<init>
  • Assert.assertEquals
  • BatchWriter.addMutation
  • Connector.createBatchWriter
  • Mutation.put
  • Mutation.<init>
  • BatchWriter.close
origin: prestodb/presto

public void createAccumuloTable(String table)
{
  try {
    connector.tableOperations().create(table);
  }
  catch (AccumuloException | AccumuloSecurityException e) {
    throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, "Failed to create Accumulo table", e);
  }
  catch (TableExistsException e) {
    throw new PrestoException(ACCUMULO_TABLE_EXISTS, "Accumulo table already exists", e);
  }
}
origin: org.apache.accumulo/accumulo-test

@Test
public void testRealWrite() throws Exception {
 Connector c = getConnector();
 c.tableOperations().create(TEST_TABLE);
 BatchWriter bw = c.createBatchWriter(TEST_TABLE, new BatchWriterConfig());
 Mutation m = new Mutation("Key");
 m.put("", "", "");
 bw.addMutation(m);
 bw.close();
 handleWriteTests(true);
}
origin: org.apache.accumulo/accumulo-test

@Test
public void createTableInDefaultNamespace() throws Exception {
 String tableName = "1";
 c.tableOperations().create(tableName);
 assertTrue(c.tableOperations().exists(tableName));
}
origin: org.apache.accumulo/accumulo-test

@Test
public void createTable() throws TableExistsException, AccumuloException,
  AccumuloSecurityException, TableNotFoundException {
 String tableName = getUniqueNames(1)[0];
 connector.tableOperations().create(tableName);
 Iterable<Map.Entry<String,String>> itrProps = connector.tableOperations()
   .getProperties(tableName);
 Map<String,String> props = propsToMap(itrProps);
 assertEquals(DefaultKeySizeConstraint.class.getName(),
   props.get(Property.TABLE_CONSTRAINT_PREFIX.toString() + "1"));
 connector.tableOperations().delete(tableName);
}
origin: org.apache.accumulo/accumulo-test

@Test
public void testNoFiles() throws Exception {
 Connector conn = getConnector();
 String tableName = getUniqueNames(1)[0];
 conn.tableOperations().create(tableName);
 KeyExtent ke = new KeyExtent("0", null, null);
 Mutation mut = ke.getPrevRowUpdateMutation();
 TabletsSection.ServerColumnFamily.TIME_COLUMN.put(mut, new Value("M0".getBytes()));
 TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN.put(mut,
   new Value("/default_tablet".getBytes()));
 BatchWriter bw1 = conn.createBatchWriter(tableName, new BatchWriterConfig());
 bw1.addMutation(mut);
 bw1.close();
 BatchWriter bw2 = conn.createBatchWriter(tableName, new BatchWriterConfig());
 MetadataTableUtil.initializeClone(tableName, "0", "1", conn, bw2);
 int rc = MetadataTableUtil.checkClone(tableName, "0", "1", conn, bw2);
 assertEquals(0, rc);
 // scan tables metadata entries and confirm the same
}
origin: org.apache.accumulo/accumulo-test

private void testDropNone(Map<String,String> options) throws Exception {
 Connector c = getConnector();
 String tableName = getUniqueNames(1)[0];
 c.tableOperations().create(tableName);
 writeFlush(c, tableName, "a");
 writeFlush(c, tableName, "b");
 CompactionStrategyConfig csConfig = new CompactionStrategyConfig(
   TestCompactionStrategy.class.getName());
 csConfig.setOptions(options);
 c.tableOperations().compact(tableName,
   new CompactionConfig().setWait(true).setCompactionStrategy(csConfig));
 Assert.assertEquals(ImmutableSet.of("a", "b"), getRows(c, tableName));
}
origin: org.calrissian.accumulorecipes/entity-store

public EntityKeyValueIndex(Connector connector, String indexTable, ShardBuilder<Entity> shardBuilder, StoreConfig config, TypeRegistry<String> typeRegistry) throws TableNotFoundException, TableExistsException, AccumuloSecurityException, AccumuloException {
  this.shardBuilder = shardBuilder;
  this.typeRegistry = typeRegistry;
  if(!connector.tableOperations().exists(indexTable))
    connector.tableOperations().create(indexTable);
  writer = connector.createBatchWriter(indexTable, config.getMaxMemory(), config.getMaxLatency(), config.getMaxWriteThreads());
}
origin: org.apache.accumulo/accumulo-test

private void writeData(String tableName, Connector conn)
  throws AccumuloException, AccumuloSecurityException, TableExistsException,
  TableNotFoundException, MutationsRejectedException {
 TreeSet<Text> splits = new TreeSet<>();
 for (int i = 1; i < 100; i++) {
  splits.add(new Text(String.format("%06d", i * 100)));
 }
 conn.tableOperations().create(tableName);
 conn.tableOperations().addSplits(tableName, splits);
 BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig());
 for (int i = 0; i < 100; i++) {
  String row = String.format("%06d", i * 100 + 3);
  Mutation m = new Mutation(row);
  m.put("cf1", "cq1", "1");
  bw.addMutation(m);
 }
 bw.close();
}
origin: org.apache.accumulo/accumulo-test

@Test
public void testCompactEmptyTableWithGeneratorIterator() throws TableExistsException,
  AccumuloException, AccumuloSecurityException, TableNotFoundException {
 String tableName = getUniqueNames(1)[0];
 connector.tableOperations().create(tableName);
 List<IteratorSetting> list = new ArrayList<>();
 list.add(new IteratorSetting(15, HardListIterator.class));
 connector.tableOperations().compact(tableName, null, null, list, true, true);
 Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY);
 Map<Key,Value> actual = new TreeMap<>(COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ
 for (Map.Entry<Key,Value> entry : scanner)
  actual.put(entry.getKey(), entry.getValue());
 assertEquals(HardListIterator.allEntriesToInject, actual);
 connector.tableOperations().delete(tableName);
}
origin: org.apache.accumulo/accumulo-test

@Test(expected = AccumuloException.class)
public void createTableInAccumuloNamespace() throws Exception {
 String tableName = Namespaces.ACCUMULO_NAMESPACE + ".1";
 assertFalse(c.tableOperations().exists(tableName));
 c.tableOperations().create(tableName); // should fail
}
origin: org.apache.accumulo/accumulo-test

@Before
public void setupInstance() throws Exception {
 tableName = getUniqueNames(1)[0];
 conn = getConnector();
 conn.tableOperations().create(tableName);
 BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig());
 ColumnVisibility cv = new ColumnVisibility();
 // / has 1 dir
 // /local has 2 dirs 1 file
 // /local/user1 has 2 files
 bw.addMutation(Ingest.buildMutation(cv, "/local", true, false, true, 272, 12345, null));
 bw.addMutation(Ingest.buildMutation(cv, "/local/user1", true, false, true, 272, 12345, null));
 bw.addMutation(Ingest.buildMutation(cv, "/local/user2", true, false, true, 272, 12345, null));
 bw.addMutation(Ingest.buildMutation(cv, "/local/file", false, false, false, 1024, 12345, null));
 bw.addMutation(Ingest.buildMutation(cv, "/local/file", false, false, false, 1024, 23456, null));
 bw.addMutation(
   Ingest.buildMutation(cv, "/local/user1/file1", false, false, false, 2024, 12345, null));
 bw.addMutation(
   Ingest.buildMutation(cv, "/local/user1/file2", false, false, false, 1028, 23456, null));
 bw.close();
}
origin: prestodb/presto

conn.tableOperations().create(table.getFullTableName());
conn.tableOperations().create(table.getIndexTableName());
conn.tableOperations().create(table.getMetricsTableName());
origin: org.apache.fluo/fluo-recipes-accumulo

ExportTask(String instanceName, String zookeepers, String user, String password, String table)
  throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
 ZooKeeperInstance zki = new ZooKeeperInstance(
   new ClientConfiguration().withInstance(instanceName).withZkHosts(zookeepers));
 // TODO need to close batch writer
 Connector conn = zki.getConnector(user, new PasswordToken(password));
 try {
  bw = conn.createBatchWriter(table, new BatchWriterConfig());
 } catch (TableNotFoundException tnfe) {
  try {
   conn.tableOperations().create(table);
  } catch (TableExistsException e) {
   // nothing to do
  }
  bw = conn.createBatchWriter(table, new BatchWriterConfig());
 }
}
origin: org.apache.accumulo/accumulo-test

@Test
public void testMapWithBatchScanner() throws Exception {
 final String TEST_TABLE_2 = getUniqueNames(1)[0];
 Connector c = getConnector();
 c.tableOperations().create(TEST_TABLE_2);
 BatchWriter bw = c.createBatchWriter(TEST_TABLE_2, new BatchWriterConfig());
 for (int i = 0; i < 100; i++) {
  Mutation m = new Mutation(new Text(String.format("%09x", i + 1)));
  m.put(new Text(), new Text(), new Value(String.format("%09x", i).getBytes()));
  bw.addMutation(m);
 }
 bw.close();
 Assert.assertEquals(0, MRTester
   .main(new String[] {TEST_TABLE_2, AccumuloInputFormat.class.getName(), "True", "False"}));
 assertEquals(1, assertionErrors.get(TEST_TABLE_2 + "_map").size());
 assertEquals(1, assertionErrors.get(TEST_TABLE_2 + "_cleanup").size());
}
origin: org.apache.accumulo/accumulo-test

@Test
public void testCompactEmptyTableWithGeneratorIterator_Splits() throws TableExistsException,
  AccumuloException, AccumuloSecurityException, TableNotFoundException {
 String tableName = getUniqueNames(1)[0];
 connector.tableOperations().create(tableName);
 SortedSet<Text> splitset = new TreeSet<>();
 splitset.add(new Text("f"));
 connector.tableOperations().addSplits(tableName, splitset);
 List<IteratorSetting> list = new ArrayList<>();
 list.add(new IteratorSetting(15, HardListIterator.class));
 connector.tableOperations().compact(tableName, null, null, list, true, true);
 Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY);
 Map<Key,Value> actual = new TreeMap<>(COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ
 for (Map.Entry<Key,Value> entry : scanner)
  actual.put(entry.getKey(), entry.getValue());
 assertEquals(HardListIterator.allEntriesToInject, actual);
 connector.tableOperations().delete(tableName);
}
origin: org.apache.accumulo/accumulo-test

@Test
public void run() throws Exception {
 Connector c = getConnector();
 String[] tableNames = getUniqueNames(2);
 String bwft = tableNames[0];
 c.tableOperations().create(bwft);
 String bwlt = tableNames[1];
 c.tableOperations().create(bwlt);
 runFlushTest(bwft);
 runLatencyTest(bwlt);
}
origin: org.apache.accumulo/accumulo-test

 @Test
 public void testMerge() throws Exception {
  // create a fake metadata table
  String metadataTableName = getUniqueNames(1)[0];
  getConnector().tableOperations().create(metadataTableName);

  KeyExtent ke1 = new KeyExtent("0", new Text("m"), null);
  Mutation mut1 = ke1.getPrevRowUpdateMutation();
  TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN.put(mut1, new Value("/d1".getBytes()));

  KeyExtent ke2 = new KeyExtent("0", null, null);
  Mutation mut2 = ke2.getPrevRowUpdateMutation();
  TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN.put(mut2, new Value("/d2".getBytes()));

  BatchWriter bw1 = getConnector().createBatchWriter(metadataTableName, new BatchWriterConfig());
  bw1.addMutation(mut1);
  bw1.addMutation(mut2);
  bw1.close();

  TestTabletIterator tabIter = new TestTabletIterator(getConnector(), metadataTableName);

  exception.expect(TabletDeletedException.class);
  while (tabIter.hasNext()) {
   tabIter.next();
  }
 }
}
origin: prestodb/presto

conn.tableOperations().create(table.getFullTableName());
conn.tableOperations().create(table.getIndexTableName());
conn.tableOperations().create(table.getMetricsTableName());
origin: org.apache.accumulo/accumulo-test

@Test
public void testMap() throws Exception {
 final String TEST_TABLE_1 = getUniqueNames(1)[0];
 Connector c = getConnector();
 c.tableOperations().create(TEST_TABLE_1);
 BatchWriter bw = c.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig());
 for (int i = 0; i < 100; i++) {
  Mutation m = new Mutation(new Text(String.format("%09x", i + 1)));
  m.put(new Text(), new Text(), new Value(String.format("%09x", i).getBytes()));
  bw.addMutation(m);
 }
 bw.close();
 Assert.assertEquals(0,
   MRTester.main(new String[] {TEST_TABLE_1, AccumuloInputFormat.class.getName()}));
 assertEquals(1, assertionErrors.get(TEST_TABLE_1 + "_map").size());
 assertEquals(1, assertionErrors.get(TEST_TABLE_1 + "_cleanup").size());
}
origin: org.apache.accumulo/accumulo-test

@SuppressWarnings("deprecation")
@Test
public void tableNameOnly() throws Exception {
 log.info("Starting tableNameOnly");
 // Create a table with the initial properties
 Connector connector = getConnector();
 String tableName = getUniqueNames(2)[0];
 connector.tableOperations().create(tableName, new NewTableConfiguration());
 String tableNameOrig = "original";
 connector.tableOperations().create(tableNameOrig, true);
 int countNew = numProperties(connector, tableName);
 int countOrig = compareProperties(connector, tableNameOrig, tableName, null);
 Assert.assertEquals("Extra properties using the new create method", countOrig, countNew);
 Assert.assertTrue("Wrong TimeType", checkTimeType(connector, tableName, TimeType.MILLIS));
}
org.apache.accumulo.core.client.adminTableOperationscreate

Javadoc

Create a table with no special configuration

Popular methods of TableOperations

  • exists
    A method to check if a table exists in Accumulo.
  • delete
    Delete a table
  • attachIterator
    Add an iterator to a table on the given scopes.
  • setProperty
    Sets a property on a table. This operation is asynchronous and eventually consistent. Not all tablet
  • addSplits
    Ensures that tablets are split along a set of keys. Note that while the documentation for Text speci
  • list
    Retrieve a list of tables in Accumulo.
  • tableIdMap
    Get a mapping of table name to internal table id.
  • listIterators
    Get a list of iterators for this table.
  • listSplits
  • compact
    Starts a full major compaction of the tablets in the range (start, end]. The compaction is preformed
  • flush
    Flush a table's data that is currently in memory.
  • getProperties
    Gets properties of a table. This operation is asynchronous and eventually consistent. It is not guar
  • flush,
  • getProperties,
  • setLocalityGroups,
  • deleteRows,
  • removeIterator,
  • getIteratorSetting,
  • importDirectory,
  • testClassLoad,
  • getLocalityGroups

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now