@Override protected void setPlugin(final CommandLine cl, final Shell shellState, final String tableName, final String className) throws AccumuloException, AccumuloSecurityException { super.setPlugin(cl, shellState, tableName, className); if (cl.hasOption(interpeterOption.getOpt())) { shellState.getAccumuloClient().tableOperations().setProperty(tableName, Property.TABLE_INTERPRETER_CLASS.toString(), className); } }
protected void setPlugin(final CommandLine cl, final Shell shellState, final String tableName, final String className) throws AccumuloException, AccumuloSecurityException { shellState.getAccumuloClient().tableOperations().setProperty(tableName, tableProp.toString(), className); }
STATUS_FORMATTER_CLASS_NAME); try { tops.setProperty(tableName, Property.TABLE_FORMATTER_CLASS.getKey(), STATUS_FORMATTER_CLASS_NAME); } catch (AccumuloException | AccumuloSecurityException e) { tops.setProperty(tableName, Property.TABLE_FORMATTER_CLASS.getKey(), STATUS_FORMATTER_CLASS_NAME); } catch (AccumuloException | AccumuloSecurityException e) {
for (Entry<String,String> entry : configuration) { if (Property.isValidTablePropertyKey(entry.getKey())) { shellState.getAccumuloClient().tableOperations().setProperty(tableName, entry.getKey(), entry.getValue()); final String formatterClass = cl.getOptionValue(createTableOptFormatter.getOpt()); shellState.getAccumuloClient().tableOperations().setProperty(tableName, Property.TABLE_FORMATTER_CLASS.toString(), formatterClass);
new ColumnVisibility(value); // validate that it is a valid expression shellState.getAccumuloClient().tableOperations().setProperty(tableName, property, value); Shell.log.debug("Successfully set table configuration option."); } else if (namespace != null) {
accumuloClient.tableOperations().attachIterator(tableName, setting); accumuloClient.tableOperations().setProperty(tableName, Property.TABLE_FORMATTER_CLASS.getKey(), TraceFormatter.class.getName()); break;
private static void configureAgeOff(TableOperations tops, String tableName, int numDays) { for (IteratorUtil.IteratorScope scope : IteratorUtil.IteratorScope.values()) { String stem = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope, AGE_OFF); try { tops.setProperty(tableName, stem + ".opt.ttl", "45"); tops.setProperty(tableName, stem, "18,datawave.iterators.filter.DateInRowAgeOffFilter"); } catch (AccumuloException | AccumuloSecurityException e) { log.error("Could not create age off configuration for " + stem, e); } } }
public void setDegreeTableTotal(final String degreeTable, final long total) { try { connector.tableOperations().setProperty(degreeTable, PROP_TOTAL, Long.toString(total)); } catch (AccumuloException | AccumuloSecurityException e) { log.error("problem setting table property "+PROP_TOTAL+" on table "+degreeTable+" to "+total, e); } }
public void SetConfig(String table, String key, String value) throws AccumuloSecurityException, AccumuloException { // try { connector.tableOperations().setProperty(table, key, value); // } catch (AccumuloException | AccumuloSecurityException e) { // log.error("problem setting table :: key :: value ==> "+table+" :: "+key+" :: "+value, e); // } }
@Override protected void setPlugin(final CommandLine cl, final Shell shellState, final String tableName, final String className) throws AccumuloException, AccumuloSecurityException { super.setPlugin(cl, shellState, tableName, className); if (cl.hasOption(interpeterOption.getOpt())) { shellState.getConnector().tableOperations().setProperty(tableName, Property.TABLE_INTERPRETER_CLASS.toString(), className); } }
@Override public void createSchema() throws GoraException { try { conn.tableOperations().create(mapping.tableName); Set<Entry<String,String>> es = mapping.tableConfig.entrySet(); for (Entry<String,String> entry : es) { conn.tableOperations().setProperty(mapping.tableName, entry.getKey(), entry.getValue()); } } catch (TableExistsException e) { LOG.debug(e.getMessage(), e); // Assume this is not an error } catch (AccumuloException | AccumuloSecurityException e) { throw new GoraException(e); } }
protected void setPlugin(final CommandLine cl, final Shell shellState, final String tableName, final String className) throws AccumuloException, AccumuloSecurityException { shellState.getConnector().tableOperations().setProperty(tableName, tableProp.toString(), className); }
@Override public void setTableProperty(ByteBuffer login, String tableName, String property, String value) throws org.apache.accumulo.proxy.thrift.AccumuloException, org.apache.accumulo.proxy.thrift.AccumuloSecurityException, org.apache.accumulo.proxy.thrift.TableNotFoundException, TException { try { getConnector(login).tableOperations().setProperty(tableName, property, value); } catch (Exception e) { handleExceptionTNF(e); } }
private String[] init() throws Exception { String[] tableNames = getUniqueNames(4); Connector c = getConnector(); TableOperations tableOps = c.tableOperations(); createTable(tableNames[0]); createTable(tableNames[1]); createTable(tableNames[2]); createTable(tableNames[3]); // default is sync tableOps.setProperty(tableNames[1], Property.TABLE_DURABILITY.getKey(), "flush"); tableOps.setProperty(tableNames[2], Property.TABLE_DURABILITY.getKey(), "log"); tableOps.setProperty(tableNames[3], Property.TABLE_DURABILITY.getKey(), "none"); return tableNames; }
private void test1(Connector c) throws Exception { basicTest(c, REG_TABLE_NAME, 0); c.tableOperations().setProperty(REG_TABLE_NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "" + SPLIT_THRESH); sleepUninterruptibly(timeoutFactor * 12, TimeUnit.SECONDS); log.info("checking splits"); FunctionalTestUtils.checkSplits(c, REG_TABLE_NAME, NUM_PRE_SPLITS / 2, NUM_PRE_SPLITS * 4); verify(c, REG_TABLE_NAME); }
@Test public void test() throws Exception { final Connector c = getConnector(); final String tableName = getUniqueNames(1)[0]; c.tableOperations().create(tableName); c.tableOperations().setProperty(tableName, Property.TABLE_COMPACTION_STRATEGY.getKey(), SimpleCompactionStrategy.class.getName()); runTest(c, tableName, 3); c.tableOperations().setProperty(tableName, Property.TABLE_COMPACTION_STRATEGY_PREFIX.getKey() + "count", "" + 5); runTest(c, tableName, 5); }
public void overrideUidAggregator() throws AccumuloSecurityException, AccumuloException { for (IteratorUtil.IteratorScope scope : IteratorUtil.IteratorScope.values()) { String stem = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope.name(), "UIDAggregator"); // Override the UidAggregator with a mock aggregator to lower the UID.List MAX uid limit. connector.tableOperations().setProperty(SHARD_INDEX_TABLE_NAME, stem + ".opt.*", "datawave.query.util.InMemoryGlobalIndexUidAggregator"); connector.tableOperations().setProperty(SHARD_RINDEX_TABLE_NAME, stem + ".opt.*", "datawave.query.util.InMemoryGlobalIndexUidAggregator"); } }
@Test public void test() throws Exception { Connector c = getConnector(); assertEquals(1, c.tableOperations().listSplits(MetadataTable.NAME).size()); c.tableOperations().setProperty(MetadataTable.NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "500"); for (int i = 0; i < 10; i++) { c.tableOperations().create("table" + i); c.tableOperations().flush(MetadataTable.NAME, null, null, true); } sleepUninterruptibly(10, TimeUnit.SECONDS); assertTrue(c.tableOperations().listSplits(MetadataTable.NAME).size() > 2); } }
@Test(timeout = 4 * 60 * 1000) public void testIncreaseDurability() throws Exception { Connector c = getConnector(); String tableName = getUniqueNames(1)[0]; c.tableOperations().create(tableName); c.tableOperations().setProperty(tableName, Property.TABLE_DURABILITY.getKey(), "none"); writeSome(tableName, N); restartTServer(); long numResults = readSome(tableName); assertTrue("Expected " + N + " >= " + numResults, N >= numResults); c.tableOperations().setProperty(tableName, Property.TABLE_DURABILITY.getKey(), "sync"); writeSome(tableName, N); restartTServer(); assertTrue(N == readSome(tableName)); }
@Test(timeout = 3 * 60 * 1000) public void durableTableLosesNonDurableWrites() throws Exception { Connector c = getConnector(); String tableName = getUniqueNames(1)[0]; // table default is durable writes c.tableOperations().create(tableName); c.tableOperations().setProperty(tableName, Property.TABLE_DURABILITY.getKey(), "sync"); // write with no durability BatchWriterConfig cfg = new BatchWriterConfig(); cfg.setDurability(Durability.NONE); writeSome(tableName, 10, cfg); // verify writes are lost on restart restartTServer(); assertTrue(10 > count(tableName)); }