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-15590 - Context Listener to start CoreContainer #397
Closed
Closed
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
40e54dd
Make an admin servlet that does nothing, migrate close shielding to u…
gus-asf ba2b7ab
reuse path exclusion
gus-asf a4e8235
pull out tracing and rate limiting for later re-use (requires access …
gus-asf 24b0a46
CoreService to grant access to the CoreContainer which is started as …
gus-asf a37a814
Review feedback, but PR is too stale so will need to re-do on new branch
gus-asf 7096a0d
Cleanup and comments
gus-asf 6363f20
Address a couple sonatype-lift warnings
gus-asf 6f49f80
More sonatype-lift inspired thread safety touch-up
gus-asf feeb89e
Touch up ArrayList usage
gus-asf c05c9b4
Merge from main
gus-asf File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
solr/core/src/java/org/apache/solr/servlet/AdminServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.apache.solr.servlet; | ||
|
||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.regex.Pattern; | ||
|
||
import static org.apache.solr.servlet.ServletUtils.closeShield; | ||
import static org.apache.solr.servlet.ServletUtils.configExcludes; | ||
import static org.apache.solr.servlet.ServletUtils.excludedPath; | ||
|
||
@WebServlet | ||
public class AdminServlet extends HttpServlet implements PathExcluder{ | ||
private ArrayList<Pattern> excludes; | ||
|
||
@Override | ||
public void init() throws ServletException { | ||
configExcludes(this, getInitParameter("excludePatterns")); | ||
} | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | ||
req = closeShield(req, false); | ||
resp = closeShield(resp, false); | ||
if (excludedPath(excludes,req,resp,null)) { | ||
return; | ||
} | ||
super.doGet(req, resp); | ||
} | ||
|
||
@Override | ||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | ||
req = closeShield(req, false); | ||
resp = closeShield(resp, false); | ||
if (excludedPath(excludes,req,resp,null)) { | ||
return; | ||
} | ||
super.doPost(req, resp); | ||
} | ||
|
||
@Override | ||
public void setExcludePatterns(ArrayList<Pattern> excludePatterns) { | ||
this.excludes = excludePatterns; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.apache.solr.servlet; | ||
|
||
import java.util.ArrayList; | ||
import java.util.regex.Pattern; | ||
|
||
public interface PathExcluder { | ||
void setExcludePatterns(ArrayList<Pattern> excludePatterns); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we really need this? And I wonder if "excludePatterns" is a feature that like one person/company uses.
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.
That's a valid question, but probably deserves it's own issue/discussion.
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.
I did notice this: which seems to say that this is relied upon by the admin UI. https://issues.apache.org/jira/browse/SOLR-11228