druid/docs/api-reference
zachjsh ab7d9bc6ec
Add api for Retrieving unused segments (#15415)
### Description

This pr adds an api for retrieving unused segments for a particular datasource. The api supports pagination by the addition of `limit` and `lastSegmentId` parameters. The resulting unused segments are returned with optional `sortOrder`, `ASC` or `DESC` with respect to the matching segments `id`, `start time`, and `end time`, or not returned in any guarenteed order if `sortOrder` is not specified

`GET /druid/coordinator/v1/datasources/{dataSourceName}/unusedSegments?interval={interval}&limit={limit}&lastSegmentId={lastSegmentId}&sortOrder={sortOrder}`

Returns a list of unused segments for a datasource in the cluster contained within an optionally specified interval.
Optional parameters for limit and lastSegmentId can be given as well, to limit results and enable paginated results.
The results may be sorted in either ASC, or DESC order depending on specifying the sortOrder parameter.

`dataSourceName`: The name of the datasource
`interval`:                 the specific interval to search for unused segments for.
`limit`:                      the maximum number of unused segments to return information about. This property helps to
                                 support pagination
`lastSegmentId`:     the last segment id from which to search for results. All segments returned are > this segment 
                                 lexigraphically if sortOrder is null or ASC, or < this segment lexigraphically if sortOrder is DESC.
`sortOrder`:            Specifies the order with which to return the matching segments by start time, end time. A null
                                value indicates that order does not matter.

This PR has:

- [x] been self-reviewed.
   - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
- [x] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [x] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [x] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
- [ ] added integration tests.
- [x] been tested in a test Druid cluster.
2023-12-11 16:32:18 -05:00
..
api-reference.md API reference refactor (#14372) 2023-06-26 15:48:54 -07:00
automatic-compaction-api.md docs: fix code tabs (#15403) 2023-11-20 11:16:10 -08:00
data-management-api.md Data management API doc refactor (#15087) 2023-11-20 12:34:42 -08:00
dynamic-configuration-api.md Dynamic configuration API documentation refactor (#15098) 2023-10-11 14:45:05 -07:00
json-querying-api.md Docusaurus2 upgrade for master (#14411) 2023-08-16 19:01:21 -07:00
legacy-metadata-api.md Add api for Retrieving unused segments (#15415) 2023-12-11 16:32:18 -05:00
lookups-api.md API reference refactor (#14372) 2023-06-26 15:48:54 -07:00
retention-rules-api.md Docusaurus2 upgrade for master (#14411) 2023-08-16 19:01:21 -07:00
service-status-api.md Docusaurus2 upgrade for master (#14411) 2023-08-16 19:01:21 -07:00
sql-api.md Docs: update SQL API reference (#15515) 2023-12-08 11:53:19 -08:00
sql-ingestion-api.md Add worker status and duration metrics in live and task reports (#15180) 2023-10-30 09:43:22 +05:30
sql-jdbc.md [Docs] Add example connection parameters for Java APIs (#15345) 2023-11-28 15:09:41 +05:30
supervisor-api.md docs: fix code tabs (#15403) 2023-11-20 11:16:10 -08:00
tasks-api.md Docusaurus2 upgrade for master (#14411) 2023-08-16 19:01:21 -07:00