@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { final String tableName = OptUtil.getTableOpt(cl, shellState); final Text startRow = OptUtil.getStartRow(cl); final Text endRow = OptUtil.getEndRow(cl); if (!cl.hasOption(forceOpt.getOpt()) && (startRow == null || endRow == null)) { shellState.getReader() .println("Not deleting unbounded range. Specify both ends, or use --force"); return 1; } shellState.getAccumuloClient().tableOperations().deleteRows(tableName, startRow, endRow); return 0; }
@Override protected void doTableOp() throws Exception { c.tableOperations().deleteRows(table, null, null); } }));
conn.tableOperations().deleteRows(tableName, range.get(0), range.get(1)); log.debug("deleted rows (" + range.get(0) + " -> " + range.get(1) + "] in " + tableName); } catch (TableNotFoundException tne) {
@Override public void clearData() { try { this.connector.tableOperations().deleteRows(getDataTableName(), null, null); this.connector.tableOperations().deleteRows(getEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getVerticesTableName(), null, null); this.connector.tableOperations().deleteRows(getMetadataTableName(), null, null); getSearchIndex().clearData(); } catch (Exception ex) { throw new VertexiumException("Could not delete rows", ex); } }
@Override public void clearData() { try { this.connector.tableOperations().deleteRows(getDataTableName(), null, null); this.connector.tableOperations().deleteRows(getEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getVerticesTableName(), null, null); this.connector.tableOperations().deleteRows(getMetadataTableName(), null, null); getSearchIndex().clearData(); } catch (Exception ex) { throw new SecureGraphException("Could not delete rows", ex); } }
@Override public void truncate() { try { this.connector.tableOperations().deleteRows(getDataTableName(), null, null); this.connector.tableOperations().deleteRows(getEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getVerticesTableName(), null, null); this.connector.tableOperations().deleteRows(getExtendedDataTableName(), null, null); this.connector.tableOperations().deleteRows(getMetadataTableName(), null, null); if (isHistoryInSeparateTable()) { this.connector.tableOperations().deleteRows(getHistoryEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getHistoryVerticesTableName(), null, null); } getSearchIndex().truncate(this); } catch (Exception ex) { throw new VertexiumException("Could not delete rows", ex); } }
@Override public void truncate() { try { this.connector.tableOperations().deleteRows(getDataTableName(), null, null); this.connector.tableOperations().deleteRows(getEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getVerticesTableName(), null, null); this.connector.tableOperations().deleteRows(getExtendedDataTableName(), null, null); this.connector.tableOperations().deleteRows(getMetadataTableName(), null, null); if (isHistoryInSeparateTable()) { this.connector.tableOperations().deleteRows(getHistoryEdgesTableName(), null, null); this.connector.tableOperations().deleteRows(getHistoryVerticesTableName(), null, null); } getSearchIndex().truncate(this); } catch (Exception ex) { throw new VertexiumException("Could not delete rows", ex); } }
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { final String tableName = OptUtil.getTableOpt(cl, shellState); final Text startRow = OptUtil.getStartRow(cl); final Text endRow = OptUtil.getEndRow(cl); if (!cl.hasOption(forceOpt.getOpt()) && (startRow == null || endRow == null)) { shellState.getReader() .println("Not deleting unbounded range. Specify both ends, or use --force"); return 1; } shellState.getConnector().tableOperations().deleteRows(tableName, startRow, endRow); return 0; }
@Override public void deleteRows(ByteBuffer login, String tableName, ByteBuffer startRow, ByteBuffer endRow) throws org.apache.accumulo.proxy.thrift.AccumuloException, org.apache.accumulo.proxy.thrift.AccumuloSecurityException, org.apache.accumulo.proxy.thrift.TableNotFoundException, TException { try { getConnector(login).tableOperations().deleteRows(tableName, ByteBufferUtil.toText(startRow), ByteBufferUtil.toText(endRow)); } catch (Exception e) { handleExceptionTNF(e); } }
@Test public void testCloneWithSplits() throws Exception { Connector conn = getConnector(); List<Mutation> mutations = new ArrayList<>(); TreeSet<Text> splits = new TreeSet<>(); for (int i = 0; i < 10; i++) { splits.add(new Text(Integer.toString(i))); Mutation m = new Mutation(Integer.toString(i)); m.put("", "", ""); mutations.add(m); } String[] tables = getUniqueNames(2); conn.tableOperations().create(tables[0]); conn.tableOperations().addSplits(tables[0], splits); BatchWriter bw = conn.createBatchWriter(tables[0], new BatchWriterConfig()); bw.addMutations(mutations); bw.close(); conn.tableOperations().clone(tables[0], tables[1], true, null, null); conn.tableOperations().deleteRows(tables[1], new Text("4"), new Text("8")); List<String> rows = Arrays.asList("0", "1", "2", "3", "4", "9"); List<String> actualRows = new ArrayList<>(); for (Entry<Key,Value> entry : conn.createScanner(tables[1], Authorizations.EMPTY)) { actualRows.add(entry.getKey().getRow().toString()); } Assert.assertEquals(rows, actualRows); }
ops.deleteRows(table, null, null);
c.tableOperations().deleteRows(tableName, null, null);
c.tableOperations().deleteRows(table, startText, endText); Collection<Text> remainingSplits = c.tableOperations().listSplits(table); StringBuilder sb = new StringBuilder();
conn.tableOperations().deleteRows(tableName, start, end);
} catch (RuntimeException ex) {} try { auditConnector.tableOperations().deleteRows(OLD_TEST_TABLE_NAME, new Text("myRow"), new Text("myRow~")); } catch (AccumuloSecurityException ex) {}
auditConnector.tableOperations().deleteRows(OLD_TEST_TABLE_NAME, new Text("myRow"), new Text("myRow~"));
@Test(timeout = 5 * 60 * 1000) public void testDeleteAllRows() throws Exception { Connector c = getConnector(); String[] tableNames = this.getUniqueNames(20); for (String tableName : tableNames) { c.tableOperations().create(tableName); c.tableOperations().deleteRows(tableName, null, null); Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY); assertEquals(0, Iterators.size(scanner.iterator())); } }
public static void clearTable() { TableOperations tableoper = con.tableOperations(); if (!tableoper.exists("tab1")) { try { tableoper.create("tab1"); } catch (Exception e) { logger.error("error in test helper"); DTThrowable.rethrow(e); } } try { tableoper.deleteRows("tab1", null, null); } catch (AccumuloException e) { logger.error("error in test helper"); DTThrowable.rethrow(e); } catch (AccumuloSecurityException e) { logger.error("error in test helper"); DTThrowable.rethrow(e); } catch (TableNotFoundException e) { logger.error("error in test helper"); DTThrowable.rethrow(e); } }
accumuloConn.tableOperations().deleteRows(pcjTableName, null, null); } catch (AccumuloException | AccumuloSecurityException | TableNotFoundException e) { throw new PCJStorageException("Could not delete the rows of data from PCJ table named: " + pcjTableName, e);
conn.securityOperations().grantTablePermission("root", ReplicationTable.NAME, TablePermission.WRITE); conn.tableOperations().deleteRows(ReplicationTable.NAME, null, null);