mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-07 13:38:49 +00:00
JobDataDeleter handles the deletion logic for 3 cases: 1. deleting a model snapshot and its state docs 2. deleting all results after a timestamp 3. deleting all interim results The last 2 are currently implemented by manually performing a search and scroll and then adding matching hits in a bulk delete action. This operation is exactly what delete-by-query does. This commit changes JobDataDeleter to use delete-by-query. This makes the code simpler and less error-prone. The downside is losing some logging which seems non-critical. Unit tests for JobDataDeleter are also removed as they are heavily mocked tests, adding little value and high maintenance cost. This functionality is tested by integration tests already. relates elastic/x-pack-elasticsearch#821 Original commit: elastic/x-pack-elasticsearch@7da91332bd