Skip to content

Add versions to markUsed and markUnused APIs#16136

Closed
abhishekrb19 wants to merge 21 commits intoapache:masterfrom
abhishekrb19:mark_used_unused_api_versions
Closed

Add versions to markUsed and markUnused APIs#16136
abhishekrb19 wants to merge 21 commits intoapache:masterfrom
abhishekrb19:mark_used_unused_api_versions

Conversation

@abhishekrb19
Copy link
Copy Markdown
Contributor

Follow up to #15994, this patch adds support for versions to the markUsed and markUnused APIs.

Segments can now be marked as used or unused within the specified interval using an optional list of versions, i.e., (interval, [versions]). When versions is unspecified, all versions of segments in the interval are marked as used or unused, preserving the old behavior before this patch.

Release note

Segments can now be marked as used or unused within the specified interval using an optional list of versions, i.e., (interval, [versions]). When versions is unspecified, all versions of segments in the interval are marked as used or unused, preserving the old behavior.

Sample markUsed API with versions:

curl 'http://localhost:8888/druid/coordinator/v1/datasources/foo/markUsed' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Content-Type: application/json' \
  -H 'Origin: http://localhost:8888' \
  --data-raw '{"interval":"2020/2030", "versions": ["2024-03-14T13:30:54.460Z"]}' 

{"numChangedSegments":15}

Sample markUnused API with versions:

curl 'http://localhost:8888/druid/coordinator/v1/datasources/foo/markUnused' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Content-Type: application/json' \
  -H 'Origin: http://localhost:8888' \
  --data-raw '{"interval":"2020/2030", "versions": ["2024-03-14T16:00:04.086Z"]}' 

{"numChangedSegments":15}

Key changed/added classes in this PR
  • SegmentsMetadataManager.java
  • SqlSegmentsMetadataManager.java
  • SqlSegmentsMetadataQuery.java
  • DatasourcesResource.java

This PR has:

  • been self-reviewed.
  • [] added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • been tested in a test Druid cluster.

@abhishekrb19
Copy link
Copy Markdown
Contributor Author

Closing this in favor of #16141 as the branch got messed up

@abhishekrb19 abhishekrb19 deleted the mark_used_unused_api_versions branch March 15, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants