-
Notifications
You must be signed in to change notification settings - Fork 94
Rest API to list all locks with option to get a specific lock #802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (31.43%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #802 +/- ##
============================================
- Coverage 33.45% 31.43% -2.02%
- Complexity 143 150 +7
============================================
Files 29 34 +5
Lines 1393 1527 +134
Branches 133 137 +4
============================================
+ Hits 466 480 +14
- Misses 890 1010 +120
Partials 37 37 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Jeremy Dupras <[email protected]>
src/main/java/org/opensearch/jobscheduler/rest/action/RestGetAllLocksAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/jobscheduler/transport/action/TransportGetAllLocksAction.java
Outdated
Show resolved
Hide resolved
...-plugin/src/test/java/org/opensearch/jobscheduler/sampleextension/SampleJobRunnerRestIT.java
Outdated
Show resolved
Hide resolved
...-plugin/src/test/java/org/opensearch/jobscheduler/sampleextension/SampleJobRunnerRestIT.java
Outdated
Show resolved
Hide resolved
...-plugin/src/test/java/org/opensearch/jobscheduler/sampleextension/SampleJobRunnerRestIT.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/jobscheduler/transport/response/GetAllLocksResponse.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Changes to SampleJobRunner have been added to ensure that the doc is updated before the lock is released. |
Signed-off-by: Craig Perkins <[email protected]>
src/main/java/org/opensearch/jobscheduler/transport/response/GetLocksResponse.java
Show resolved
Hide resolved
src/main/java/org/opensearch/jobscheduler/transport/response/GetLocksResponse.java
Outdated
Show resolved
Hide resolved
...-plugin/src/test/java/org/opensearch/jobscheduler/sampleextension/SampleJobRunnerRestIT.java
Show resolved
Hide resolved
...-plugin/src/test/java/org/opensearch/jobscheduler/sampleextension/SampleJobRunnerRestIT.java
Outdated
Show resolved
Hide resolved
...-plugin/src/test/java/org/opensearch/jobscheduler/sampleextension/SampleJobRunnerRestIT.java
Outdated
Show resolved
Hide resolved
Move ser/de logic to LockModel
Signed-off-by: Jeremy Dupras <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you @Jeremydupras !
Codecov will be fixed by #800 |
…arch-project#802) * adding active jobs by lock info Signed-off-by: Jeremy Dupras <[email protected]> * adding active jobs and tests Signed-off-by: Jeremy Dupras <[email protected]> * changing to ActionListener Signed-off-by: Jeremy Dupras <[email protected]> * fixing failing multinode test and format errors Signed-off-by: Jeremy Dupras <[email protected]> * correcting test Signed-off-by: Jeremy Dupras <[email protected]> * updating test Signed-off-by: Jeremy Dupras <[email protected]> * updating test Signed-off-by: Jeremy Dupras <[email protected]> * trying test fix Signed-off-by: Jeremy Dupras <[email protected]> * updating test Signed-off-by: Jeremy Dupras <[email protected]> * rerunning tests Signed-off-by: Jeremy Dupras <[email protected]> * removing getFirst() Signed-off-by: Jeremy Dupras <[email protected]> * removing lock search Signed-off-by: Jeremy Dupras <[email protected]> * remiving client Signed-off-by: Jeremy Dupras <[email protected]> * adding lock duration Signed-off-by: Jeremy Dupras <[email protected]> * adding getLocks API Signed-off-by: Jeremy Dupras <[email protected]> * adding test for lock transport action Signed-off-by: Jeremy Dupras <[email protected]> * adding tests Signed-off-by: Jeremy Dupras <[email protected]> * commmiting changes Signed-off-by: Jeremy Dupras <[email protected]> * adding lockid path parameter Signed-off-by: Jeremy Dupras <[email protected]> * adding tests Signed-off-by: Jeremy Dupras <[email protected]> * Empty commit message Signed-off-by: Jeremy Dupras <[email protected]> * renaming, reformatting response JSON, test changes Signed-off-by: Jeremy Dupras <[email protected]> * changing name in variable Signed-off-by: Jeremy Dupras <[email protected]> * fixing test timing Signed-off-by: Jeremy Dupras <[email protected]> * Move ser/de logic to LockModel Signed-off-by: Craig Perkins <[email protected]> * adressing comments Signed-off-by: Jeremy Dupras <[email protected]> --------- Signed-off-by: Jeremy Dupras <[email protected]> Signed-off-by: Craig Perkins <[email protected]> Co-authored-by: Jeremy Dupras <[email protected]> Co-authored-by: Craig Perkins <[email protected]> Signed-off-by: Jeremy Dupras <[email protected]>
Description
This Api gets all the locks in the job-scheduler plugin. The intention is to use this information to find the currently executing jobs by using the active locks. This API will allow the user to see whether a job is currently executing, has an active/expired lock or does not have a lock. Additionally, users will be able to look for specific lock by adding the lockID as a path parameter. API call examples are below.
-> Gets all of the locks within Job Scheduler
GET /_plugins/_job_scheduler/api/locks
-> Gets a specific lock
LOCK_ID_DELIMITER = "-"
lockID = jobIndexName + LOCK_ID_DELIMITR + jobId
GET /_plugins/_job_scheduler/api/locks/lockID
Example return JSON
Related Issues
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.