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
SOLR-16458: Migrate v2 logging APIs to JAX-RS #1160
Conversation
Hi Calvnce. I guess you're off to a good start but obviously more to do. You have a new source file here but nothing calls it; I don't think Solr uses any auto-registration based on scanning annotations (as some platforms might do). For example AddReplicaPropertyAPI is registered in CollectionsHandler. You'll want to test this of course, both an automated test but actually try it. I recommend looking at other recent PRs pertaining to the V2 APIs. |
Hi @calvnce , thanks for the PR! At a glance I agree with David - this "resource" file is a great start but we'll need to register this somewhere for it to actually get detected and wired-up at runtime. Typically this works by linking the V2 API to the v1 "RequestHandler". RequestHandlers have a For the API you're addressing in this PR, you'd need to add a similar Let me know if there's anything else I can do to help! |
Hi, @gerlowskija |
My schedule is a little inflexible at this point to set up anything formal, but I'm more than happy to help out as I can if you're alright with mostly asynchronous communication? Do you have particular questions about this PR, or APIs in Solr that we can start working through here? Beyond this PR there are some really good resources out there on getting started with Solr. I've actually done some workshops myself on Getting Started in Solr Contribution and even specifically on v1 and v2 APIs in Solr. If you're looking for more synchronous help the Solr community has started having monthly virtual "meetups". And we sporadically have "Office Hours" as well to help bootstrap new contributors interested in getting started with the project. Those are usually discussed and scheduled on Solr's "Dev" mailing list that you can find information on here. |
This commit splits up the various functional APIs in LoggingHandler and gives them separate JAX-RS endpoints. v2 APIs are now available for: - list logger levels (GET /api/node/logging/levels) - bulk update logger levels (PUT /api/node/logging/levels) - fetch log messages (GET /api/node/logging/messages) - tweak log-listener level (PUT /api/node/logging/messages/threshold)
Alright, thanks for getting the ball rolling on this @calvnce ! I pushed up some changes that take your starting point and add the remaining APIs, tests and docs. Curious if you have any thoughts or if this helps explain anything that was confusing before? Lmk! I'll aim to merge some time next week pending any major review feedback here. (I've credited you in our 'CHANGES.txt' file as 'Calvince Otieno' - let me know if you'd prefer something different.) Thanks again Calvince! |
@Override | ||
public Collection<Class<? extends JerseyResource>> getJerseyResources() { | ||
final var apis = new ArrayList<Class<? extends JerseyResource>>(); | ||
apis.addAll(handlers.get("threads").getJerseyResources()); |
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.
NULLPTR_DEREFERENCE: null (last assigned on line 176) is dereferenced.
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Help us improve LIFT! (Sonatype LiftBot external survey)
Was this a good recommendation for you? Answering this survey will not impact your Lift settings.
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
This commit splits up the various functional APIs in LoggingHandler and gives them separate JAX-RS endpoints. v2 APIs are now available for: - list logger levels (GET /api/node/logging/levels) - bulk update logger levels (PUT /api/node/logging/levels) - fetch log messages (GET /api/node/logging/messages) - tweak log-listener level (PUT /api/node/logging/messages/threshold) Co-authored-by: Calvince Otieno <sir_kolly@yahoo.com> Co-authored-by: Jason Gerlowski <gerlowskija@apache.org>
https://issues.apache.org/jira/browse/SOLR-16458
Description
As mentioned on SOLR-15781, the v2 API implemented in this PR intends to breach the of the yet to be solved v2 API endpoints.
Solution
This PR implements several v2 endpoints that together cover the functionality offered in Solr's LoggingHandler v1 API (GET /admin/info/logging)
GET /api/node/logging/levels
GET /api/node/logging/messages
PUT /api/node/logging/levels
PUT /api/node/logging/messages/threshold
Tests
See the added NodeLoggingAPITest. LoggingHandlerTest continues to pass.
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.