public void deleteAccumuloTable(String tableName) { try { connector.tableOperations().delete(tableName); } catch (AccumuloException | AccumuloSecurityException e) { throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, "Failed to delete Accumulo table", e); } catch (TableNotFoundException e) { throw new PrestoException(ACCUMULO_TABLE_DNE, "Failed to delete Accumulo table, does not exist", e); } }
@Override protected void doTableOp(final Shell shellState, final String tableName) throws Exception { shellState.getAccumuloClient().tableOperations().delete(tableName); shellState.getReader().println("Table: [" + tableName + "] has been deleted."); if (shellState.getTableName().equals(tableName)) { shellState.setTableName(""); } }
protected void doTableOp(final Shell shellState, final String namespace, boolean force) throws Exception { boolean resetContext = false; String currentTable = shellState.getTableName(); Namespace.ID namespaceId = Namespaces.getNamespaceId(shellState.getContext(), namespace); List<String> tables = Namespaces.getTableNames(shellState.getContext(), namespaceId); resetContext = tables.contains(currentTable); if (force) for (String table : shellState.getAccumuloClient().tableOperations().list()) if (table.startsWith(namespace + ".")) shellState.getAccumuloClient().tableOperations().delete(table); shellState.getAccumuloClient().namespaceOperations().delete(namespace); if (resetContext) { shellState.setTableName(""); } }
private void drop(final String tableName) throws TableNotFoundException, AccumuloException, AccumuloSecurityException { logger.info("Dropping cloudbase table: " + tableName); connector.tableOperations().delete(tableName); } }
public void deleteTable (String tableName) { try { connector.tableOperations().delete(tableName); } catch (AccumuloException | AccumuloSecurityException | TableNotFoundException e) { log.warn("",e); } }
@Override public void run() { try { cdl.countDown(); cdl.await(); c.tableOperations().delete(table); } catch (TableNotFoundException e) { // expected } catch (InterruptedException | AccumuloException | AccumuloSecurityException e) { throw new RuntimeException(e); } } });
@Override public void run() { try { for (int i = 0; i < 10; i++) c.tableOperations().delete("table" + i); } catch (Exception ex) { ref.set(ex); } } };
private void dropTables(String... tables) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { for (String t : tables) { getConnector().tableOperations().delete(t); } }
private void cleanup(String[] tableNames) throws Exception { Connector c = getConnector(); for (String tableName : tableNames) { c.tableOperations().delete(tableName); } }
@Override public void teardown() { Connector conn = getConnector(); String tableName = getTestProperty("TABLE"); try { conn.tableOperations().delete(tableName); } catch (Exception e) { log.error("Failed to delete table '" + tableName + "'", e); } }
@Override public void run() { try { UtilWaitThread.sleep(500); getConnector().tableOperations().delete(finalName); } catch (Exception ex) { throw new RuntimeException(ex); } } });
public void deleteAllTables() throws AccumuloSecurityException, AccumuloException, TableNotFoundException { for (String table : connector.tableOperations().list()) { if (table.startsWith("accumulo.")) { continue; } connector.tableOperations().delete(table); } }
@After public void deleteTables() throws Exception { Connector c = getConnector(); for (String table : c.tableOperations().list()) { if (!table.startsWith(Namespaces.ACCUMULO_NAMESPACE + ".") && !table.equals("trace")) try { c.tableOperations().delete(table); } catch (TableNotFoundException e) { // don't care } } }
private void dropTableIfExists(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { if (this.connector.tableOperations().exists(tableName)) { this.connector.tableOperations().delete(tableName); } }
@Override protected void doTableOp(final Shell shellState, final String tableName) throws Exception { shellState.getConnector().tableOperations().delete(tableName); shellState.getReader().println("Table: [" + tableName + "] has been deleted."); if (shellState.getTableName().equals(tableName)) { shellState.setTableName(""); } }
private void deleteAndCreateTable(TableOperations tops, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException { if (tops.exists(tableName)) { tops.delete(tableName); } tops.create(tableName); } }
private void recreateTable(TableOperations tops, String table) throws Exception { if (tops.exists(table)) { tops.delete(table); } tops.create(table); }
private void deleteAndCreateTable(TableOperations tops, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException { if (tops.exists(tableName)) { tops.delete(tableName); } tops.create(tableName); }
@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); }
@After public void tearDownFluo() throws Exception { client.close(); if (oserver.isConnected()) { oserver.stop(); } env.close(); aClient.tableOperations().delete(table); } }