@Test public void testDeleteRow() throws IOException { RAMDirectory directory = new RAMDirectory(); DirectoryReader reader = getIndexReader(directory); IndexWriter writer = new IndexWriter(directory, _conf.clone()); assertEquals(0, reader.numDocs()); Row row = genRow(); _action.replaceRow(row); _action.performMutate(getSearcher(reader, directory), writer); reader = commitAndReopen(reader, writer); assertEquals(1, reader.numDocs()); _action.deleteRow(row.getId()); _action.performMutate(getSearcher(reader, directory), writer); reader = commitAndReopen(reader, writer); assertEquals(0, reader.numDocs()); }
public void deleteRow(final String rowId) { _actions.add(new InternalAction() { @Override void performAction(IndexSearcherCloseable searcher, IndexWriter writer) throws IOException { writer.deleteDocuments(createRowId(rowId)); _writeRowMeter.mark(); } }); }
MutatableAction extends IndexAction { public void deleteRow(final String rowId) { _actions.add(new InternalAction() { @Override void performAction(IndexSearcherCloseable searcher, IndexWriter writer) throws IOException { writer.deleteDocuments(createRowId(rowId)); _writeRowMeter.mark(); } }); } }
MutatableAction extends IndexAction { public void deleteRow(final String rowId) { _actions.add(new InternalAction() { @Override void performAction(IndexSearcherCloseable searcher, IndexWriter writer) throws IOException { writer.deleteDocuments(createRowId(rowId)); _writeRowMeter.mark(); } }); } MutatableAction(ShardContext context); }
MutatableAction extends IndexAction { public void deleteRow(final String rowId) { _actions.add(new InternalAction() { @Override void performAction(IndexSearcherCloseable searcher, IndexWriter writer) throws IOException { writer.deleteDocuments(createRowId(rowId)); _writeRowMeter.mark(); } }); } MutatableAction(ShardContext context); void deleteRow(final String rowId); void replaceRow(final Row row); void deleteRecord(final String rowId, final String recordId); void replaceRecord(final String rowId, final Record record); void appendColumns(final String rowId, final Record record); void replaceColumns(final String rowId, final Record record); @Override void performMutate(IndexSearcherCloseable searcher, IndexWriter writer); static Term createRowId(String id); static Term createRecordId(String id); @Override void doPreCommit(IndexSearcherCloseable indexSearcher, IndexWriter writer); @Override void doPostCommit(IndexWriter writer); @Override void doPreRollback(IndexWriter writer); @Override void doPostRollback(IndexWriter writer); void mutate(RowMutation mutation); void mutate(List<RowMutation> mutations); static List<RowMutation> reduceMutates(List<RowMutation> mutations); }
MutatableAction extends IndexAction { public void deleteRow(final String rowId) { _actions.add(new InternalAction() { @Override void performAction(IndexSearcherCloseable searcher, IndexWriter writer) throws IOException { writer.deleteDocuments(createRowId(rowId)); _writeRowMeter.mark(); } }); } MutatableAction(ShardContext context); void deleteRow(final String rowId); void replaceRow(final Row row); void deleteRecord(final String rowId, final String recordId); void replaceRecord(final String rowId, final Record record); void appendColumns(final String rowId, final Record record); void replaceColumns(final String rowId, final Record record); @Override void performMutate(IndexSearcherCloseable searcher, IndexWriter writer); static Term createRowId(String id); static Term createRecordId(String id); @Override void doPreCommit(IndexSearcherCloseable indexSearcher, IndexWriter writer); @Override void doPostCommit(IndexWriter writer); @Override void doPreRollback(IndexWriter writer); @Override void doPostRollback(IndexWriter writer); void mutate(RowMutation mutation); void mutate(List<RowMutation> mutations); static List<RowMutation> reduceMutates(List<RowMutation> mutations);  }