-
Notifications
You must be signed in to change notification settings - Fork 5
Database Rework (V5) #22
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
Open
Zoriot
wants to merge
52
commits into
main
Choose a base branch
from
update/database-rework
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
…rk and cleanup project
* Added city project ID and difficulty ID validation in CityProjectDataProviderSQL. * Make PlotCreator#createPlot receive String cityProjectID parameter as we only use the ID for registering plots anyway. * Make PlotCreator#createPlot private which is now callable by #createPlot(Player, CityProject, String) or #createPlotManually(Player, String, String) * PlotCreator#createPlotManually create a plot with specified city and difficulty ID arguments, fail if IDs does not exist in the database.
* PlotDataProviderSQL#createPlot(String, String, String, String, UUID, byte) * Missing default plot_type column * Fixed to type 1 as LOCAL_INSPIRATION_MODE
* Added command info for creating plot manually * Added warning message when manually creating plot with DataProvider set to API
Only MySQL Driver is bundled by bukkit.
Align with plot-system changes. Maybe we should export that logic in a library or smt.
* Setup for plugin cache for CityProject data
* Added javadoc for ExpiringCacheMap
* Renamed CityProjectCache.java to CityProjectData.java
* Make CreatePlotMenu retrieve city project data from the plugin's cache
* New CityProjectData to cache available city project(s) with expiry refreshing
* Using ExpiringCacheMap to manage expirations of city project data
* Cache is managed onEnable of plugin by running ExpiryThread
* Cached data is then able to be retrieved
by using PlotSystemTerra#getCityProjectData
* Expiry is configurable as cache-duration-minutes in config.yml
…orrect) Also fix a small logic confusion in if.
* CityProjectData instance now initialized via the plugin class (PlotSystemTerra) * Cache expiring task timer is scrapped, it is now fetch on every #getCache call instead. * CityProjectData cache is moved to the wrapper child class 'Cache' which handle cache refreshing. * Renamed ExpiringCacheMap.java to ExpiringHashMap.java * ExpiringCacheMap's ExpiryThread now ran every 5 seconds (previously 1) since this plugin probably won't require fast refreshing rate
* for #createPlotManually use a new constant field to check for valid difficulty instead of fetching from database (Difficulty are hard-coded) * removed the deprecated #isCreationDataValid
* Check it from CityProjectData cache instead
* So it won't display square bracket
* Moved to a new section "Plot Creating" * Edited some wording
This reverts commit eb696b6.
# Conflicts: # src/main/java/com/alpsbte/plotsystemterra/PlotSystemTerra.java # src/main/java/com/alpsbte/plotsystemterra/core/config/ConfigPaths.java
* ✨ ♻️ Improve database handling Use the alpslib-io package so our plugin will share it. Also use just a plain sql file for the initialisation. Removes much overhead & the additional properties will improve performance. The (bad) StatementBuilder logic was also removed. Now it should use proper pooling. ! BREAKING CHANGE: database.db-url renamed to database.url and database.db-name renamed to database.dbname * ♻️ Improve statements with io helper + remove duplicated code * remove redundant async variants of dataprovider methods and convert all base dataproviders back to interfaces --------- Co-authored-by: Cinnazeyy <imcinnazeyy@gmail.com>
# Conflicts: # src/main/java/com/alpsbte/plotsystemterra/PlotSystemTerra.java # src/main/java/com/alpsbte/plotsystemterra/core/plotsystem/PlotCreator.java
* Moved `core.plotsystem.CityProjectData` to `core.data.CityProjectData` * Make CityProjectData#fetchDataAsync no longer static * Make CityProjectData constructor retrieve DataProvider for #fetchDataAync * Removed constructor for making static CityProjectData cache, handled via the new constructor by setting expiry below zero instead. * DataProviders is now initialized with cacheDurationMinute * DataProvider#getCityProjectData: get city project data cache
* Handle edge case if difficultyID is null. * Avoid using a branching statement as the last in a loop.
* Moved CityProjectData.Cache to a top-level reusable class * Made Cache generic with <K, V> to support multiple data models * Updated javadocs to meet new usages
…e-data [Feature] Caching for city project data & Manual plot creation
…ad of broadcasting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Missing things: