public void cleanupDocs(DocumentWriteSet docs) { client.newDocumentManager().delete(docs.stream().map(doc -> doc.getUri()).toArray(String[]::new)); }
public WriteBatch getBatchOfWriteEvents() { WriteBatchImpl batch = new WriteBatchImpl() .withBatcher(batcher) .withClient(client) .withJobBatchNumber(batchNumber) .withJobWritesSoFar(itemsSoFar) .withJobTicket(batcher.getJobTicket()); WriteEvent[] writeEvents = getWriteSet().stream() .map(writeOperation -> new WriteEventImpl() .withTargetUri(writeOperation.getUri()) .withContent(writeOperation.getContent()) .withMetadata(writeOperation.getMetadata()) ) .toArray(WriteEventImpl[]::new); batch.withItems(writeEvents); return batch; } }