-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[#11020] Make search service optional and remove App Engine Search API usage #11067
[#11020] Make search service optional and remove App Engine Search API usage #11067
Conversation
# Conflicts: # src/e2e/java/teammates/e2e/cases/BaseE2ETestCase.java # src/e2e/java/teammates/e2e/cases/InstructorHomePageE2ETest.java # src/e2e/java/teammates/e2e/pageobjects/InstructorSearchPage.java # src/main/java/teammates/common/util/Const.java # src/main/java/teammates/storage/search/SearchDocument.java # src/test/java/teammates/test/GaeSimulation.java # src/test/java/teammates/test/TestProperties.java # src/test/resources/test.template.properties
private SearchManager() { | ||
// utility class | ||
private boolean isSearchServiceActive() { | ||
return !StringHelper.isEmpty(searchServiceHost); | ||
} |
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.
Contrary to the TestProperties
counterpart, return value of this function will always be negated.
How about isSearchServiceInactive()
?
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.
@Derek-Hardy I'll leave this to later edit, if absolutely necessary
@SuppressWarnings("PMD.NonThreadSafeSingleton") // ok to ignore as method is only invoked at application startup | ||
public static void registerSearchManager(SearchManager searchManager) { | ||
if (instance == null) { | ||
instance = searchManager; |
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.
Any reason for null
check? Intuitively the registration should overwrite whatever the old instance.
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.
The instance is final and should not be changed once set in the entire application lifecycle. Since using final
obviously will not work here, this is the best alternative.
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.
First part of #11020
storage.search
package only.SearchNotImplementedException
. The latter will be translated to501 Not Implemented
status at API layer.com.google.appengine.api.search
package in the code base.