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

How to use
NewTableConfiguration
in
org.apache.accumulo.core.client.admin

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

origin: apache/accumulo

NewTableConfiguration ntc = new NewTableConfiguration();
 ntc = ntc.withSplits(new TreeSet<>(
   ShellUtil.scanFile(cl.getOptionValue(createTableOptSplit.getOpt()), decode)));
} else if (cl.hasOption(createTableOptCopySplits.getOpt())) {
  throw new TableNotFoundException(null, oldTable, null);
 ntc = ntc.withSplits(
   new TreeSet<>(shellState.getAccumuloClient().tableOperations().listSplits(oldTable)));
 ntc = ntc.createOffline();
  ntc.setTimeType(timeType).setProperties(props));
origin: apache/accumulo

/**
 * Configure iterator settings for a table prior to its creation.
 *
 * Additional calls to this method before table creation will overwrite previous iterator
 * settings.
 *
 * @param setting
 *          object specifying the properties of the iterator
 *
 * @since 2.0.0
 *
 * @see TableOperations#attachIterator(String, IteratorSetting)
 */
public NewTableConfiguration attachIterator(IteratorSetting setting) {
 return attachIterator(setting, EnumSet.allOf(IteratorScope.class));
}
origin: apache/accumulo

/**
 * Add supplied locality groups information to a NewTableConfiguration object.
 *
 * Used in conjunction with createtable shell command to allow locality groups to be configured
 * upon table creation.
 */
private NewTableConfiguration setLocalityForNewTable(CommandLine cl, NewTableConfiguration ntc) {
 HashMap<String,Set<Text>> localityGroupMap = new HashMap<>();
 String[] options = cl.getOptionValues(createTableOptLocalityProps.getOpt());
 for (String localityInfo : options) {
  final String parts[] = localityInfo.split("=", 2);
  if (parts.length < 2)
   throw new IllegalArgumentException("Missing '=' or there are spaces between entries");
  final String groupName = parts[0];
  final HashSet<Text> colFams = new HashSet<>();
  for (String family : parts[1].split(","))
   colFams.add(new Text(family.getBytes(Shell.CHARSET)));
  // check that group names are not duplicated on usage line
  if (localityGroupMap.put(groupName, colFams) != null)
   throw new IllegalArgumentException(
     "Duplicate locality group name found. Group names must be unique");
 }
 ntc.setLocalityGroups(localityGroupMap);
 return ntc;
}
origin: org.apache.accumulo/accumulo-core

@Override
@Deprecated
public void create(String tableName, boolean versioningIter, TimeType timeType)
  throws AccumuloException, AccumuloSecurityException, TableExistsException {
 NewTableConfiguration ntc = new NewTableConfiguration().setTimeType(timeType);
 if (versioningIter)
  create(tableName, ntc);
 else
  create(tableName, ntc.withoutDefaultIterators());
}
origin: org.apache.accumulo/accumulo-test

@SuppressWarnings("deprecation")
@Test
public void tableNameAndLimitVersion() throws Exception {
 log.info("Starting tableNameAndLimitVersion");
 // Create a table with the initial properties
 Connector connector = getConnector();
 String tableName = getUniqueNames(2)[0];
 boolean limitVersion = false;
 connector.tableOperations().create(tableName,
   new NewTableConfiguration().withoutDefaultIterators());
 String tableNameOrig = "originalWithLimitVersion";
 connector.tableOperations().create(tableNameOrig, limitVersion);
 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));
}
origin: apache/fluo

new NewTableConfiguration().withoutDefaultIterators()
  .setProperties(Collections.singletonMap(AccumuloProps.TABLE_DELETE_BEHAVIOR,
    AccumuloProps.TABLE_DELETE_BEHAVIOR_VALUE)));
origin: apache/fluo

ntcProps.put(AccumuloProps.TABLE_DELETE_BEHAVIOR, AccumuloProps.TABLE_DELETE_BEHAVIOR_VALUE);
NewTableConfiguration ntc = new NewTableConfiguration().withoutDefaultIterators();
ntc.setLocalityGroups(Collections.singletonMap(ColumnConstants.NOTIFY_LOCALITY_GROUP_NAME,
  Collections.singleton(new Text(ColumnConstants.NOTIFY_CF.toArray()))));
ntc.setProperties(ntcProps);
conn.tableOperations().create(config.getAccumuloTable(), ntc);
origin: org.apache.accumulo/accumulo-test

  "Running merge test " + table + " " + Arrays.asList(splits) + " " + start + " " + end);
conn.tableOperations().create(table, new NewTableConfiguration().setTimeType(TimeType.LOGICAL));
TreeSet<Text> splitSet = new TreeSet<>();
for (String split : splits) {
origin: org.apache.accumulo/accumulo-test

@Test
public void testSample() throws Exception {
 final String TEST_TABLE_3 = getUniqueNames(1)[0];
 Connector c = getConnector();
 c.tableOperations().create(TEST_TABLE_3,
   new NewTableConfiguration().enableSampling(SAMPLER_CONFIG));
 BatchWriter bw = c.createBatchWriter(TEST_TABLE_3, 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_3, AccumuloInputFormat.class.getName(), "False", "True"}));
 assertEquals(39, assertionErrors.get(TEST_TABLE_3 + "_map").size());
 assertEquals(2, assertionErrors.get(TEST_TABLE_3 + "_cleanup").size());
 assertionErrors.clear();
 Assert.assertEquals(0, MRTester
   .main(new String[] {TEST_TABLE_3, AccumuloInputFormat.class.getName(), "False", "False"}));
 assertEquals(1, assertionErrors.get(TEST_TABLE_3 + "_map").size());
 assertEquals(1, assertionErrors.get(TEST_TABLE_3 + "_cleanup").size());
 assertionErrors.clear();
 Assert.assertEquals(0, MRTester
   .main(new String[] {TEST_TABLE_3, AccumuloInputFormat.class.getName(), "True", "True"}));
 assertEquals(39, assertionErrors.get(TEST_TABLE_3 + "_map").size());
 assertEquals(2, assertionErrors.get(TEST_TABLE_3 + "_cleanup").size());
}
origin: org.apache.accumulo/accumulo-shell

  new NewTableConfiguration().setTimeType(timeType).setProperties(props));
if (partitions.size() > 0) {
 shellState.getConnector().tableOperations().addSplits(tableName, partitions);
origin: apache/accumulo

@Override
public void create(String tableName)
  throws AccumuloException, AccumuloSecurityException, TableExistsException {
 create(tableName, new NewTableConfiguration());
}
origin: org.apache.accumulo/accumulo-test

String tableName = getUniqueNames(2)[0];
connector.tableOperations().create(tableName,
  new NewTableConfiguration().setProperties(properties));
origin: org.apache.accumulo/accumulo-core

@Override
@Deprecated
public void create(String tableName, boolean limitVersion, TimeType timeType)
  throws AccumuloException, AccumuloSecurityException, TableExistsException {
 checkArgument(tableName != null, "tableName is null");
 checkArgument(timeType != null, "timeType is null");
 NewTableConfiguration ntc = new NewTableConfiguration().setTimeType(timeType);
 if (limitVersion)
  create(tableName, ntc);
 else
  create(tableName, ntc.withoutDefaultIterators());
}
origin: Accla/graphulo

NewTableConfiguration ntc = new NewTableConfiguration().withoutDefaultIterators();
origin: org.apache.fluo/fluo-core

NewTableConfiguration ntc = new NewTableConfiguration().withoutDefaultIterators();
ntc.setProperties(ntcProps);
conn.tableOperations().create(config.getAccumuloTable(), ntc);
origin: org.apache.accumulo/accumulo-test

private void runMergeTest(Connector conn, String table, String[] splits, String[] inserts,
  String start, String end, String last, long expected) throws Exception {
 log.info("table " + table);
 conn.tableOperations().create(table, new NewTableConfiguration().setTimeType(TimeType.LOGICAL));
 TreeSet<Text> splitSet = new TreeSet<>();
 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);
 }
 bw.flush();
 conn.tableOperations().merge(table, start == null ? null : new Text(start),
   end == null ? null : new Text(end));
 Mutation m = new Mutation(last);
 m.put("cf", "cq", "v");
 bw.addMutation(m);
 bw.flush();
 Scanner scanner = conn.createScanner(table, Authorizations.EMPTY);
 scanner.setRange(new Range(last));
 bw.close();
 long time = scanner.iterator().next().getKey().getTimestamp();
 if (time != expected)
  throw new RuntimeException("unexpected time " + time + " " + expected);
}
origin: org.apache.accumulo/accumulo-test

@Test
public void testSample() throws Exception {
 final String TEST_TABLE_3 = getUniqueNames(1)[0];
 Connector c = getConnector();
 c.tableOperations().create(TEST_TABLE_3,
   new NewTableConfiguration().enableSampling(SAMPLER_CONFIG));
 BatchWriter bw = c.createBatchWriter(TEST_TABLE_3, 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();
 MRTester.main(TEST_TABLE_3, "False", "True");
 Assert.assertEquals(38, e1Count);
 Assert.assertEquals(1, e2Count);
 e2Count = e1Count = 0;
 MRTester.main(TEST_TABLE_3, "False", "False");
 Assert.assertEquals(0, e1Count);
 Assert.assertEquals(0, e2Count);
 e2Count = e1Count = 0;
 MRTester.main(TEST_TABLE_3, "True", "True");
 Assert.assertEquals(38, e1Count);
 Assert.assertEquals(1, e2Count);
}
origin: org.apache.accumulo/accumulo-core

@Override
public void create(String tableName)
  throws AccumuloException, AccumuloSecurityException, TableExistsException {
 create(tableName, new NewTableConfiguration());
}
origin: visallo/vertexium

  private static void createTable(Connector connector, String tableName) {
    try {
      NewTableConfiguration config = new NewTableConfiguration()
          .withoutDefaultIterators()
          .setTimeType(TimeType.MILLIS);
      connector.tableOperations().create(tableName, config);
    } catch (Exception e) {
      throw new VertexiumException("Unable to create table " + tableName);
    }
  }
}
origin: org.apache.accumulo/accumulo-test

String tableName = getUniqueNames(1)[0];
connector.tableOperations().create(tableName,
  new NewTableConfiguration().withoutDefaultIterators());
org.apache.accumulo.core.client.adminNewTableConfiguration

Javadoc

This object stores table creation parameters. Currently includes: TimeType, whether to include default iterators, and user-specified initial properties

Most used methods

  • <init>
  • withoutDefaultIterators
    Currently the only default iterator is the VersioningIterator. This method will cause the table to b
  • setTimeType
    Configure logical or millisecond time for tables created with this configuration.
  • setProperties
    Sets additional properties to be applied to tables created with this configuration. Additional calls
  • attachIterator
    Configure iterator settings for a table prior to its creation.
  • setLocalityGroups
    Configures a table's locality groups prior to initial table creation. Allows locality groups to be s
  • checkDisjoint
  • checkTableProperties
    Verify the provided properties are valid table properties.
  • createOffline
    Create the new table in an offline state.
  • enableSampling
    Enable building a sample data set on the new table using the given sampler configuration.
  • getInitialTableState
    Return value indicating whether table is to be created in offline or online mode.
  • getProperties
    Retrieves the complete set of currently configured table properties to be applied to a table when th
  • getInitialTableState,
  • getProperties,
  • getSplits,
  • getTimeType,
  • withSplits

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
  • setRequestProperty (URLConnection)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • 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