Skip to content

Conversation

@alan-geosolutions
Copy link
Contributor

@alan-geosolutions alan-geosolutions commented Apr 8, 2025

Added code to improve deletion of tiles from the geowebcache.

The deletion happens in the BulkCallTask. The design follows single use practice with all classes having a single use. BulkCallTask chooses the best strategy for managing deletions relying on specialised classes to actually perform the steps required. A stream associated with the strategy in instantiated and executed.

Tasks such as locking/unlocking are handled in call backs so that the code can be collected in one place and tested independently from the S3BulkObject and S3OPs classes.

The primary strategies are
NoDeletionsRequired - Nothing to delete
SingleTile - Deletes a single tile
S3ObjectPathsForPrefix fetches batches of the S3SummaryObjects and deletes the associated tiles
TileRangeWithBoundedBox uses an TileRangeIterator create batches paths and then delete them.

Callbacks:
LockingDecorator - Manage locking
MarkPendingDeleteDecorator - Manage pending deletes
NotificationDecorator - Inform BlobStore that a tile has been deleted
StatisticCallbackDecorator - Keeps a note of work done which is handy when debugging

Added stats for batches to improve visibilty
Logging batch information

Modified S3BulkStorage/S3Ops for delete single tile
S3BulkStorage/S3Ops for delete TileRange tile

Not in this push:
BulkDeleteTask for Single and TileRanges
Added stats for batches to improve visibilty
Logging batch information

Modified S3BulkStorage/S3Ops for delete single tile
S3BulkStorage/S3Ops for delete TileRange tile

Not in this push:
BulkDeleteTask for Single and TileRanges
Added stats for batches to improve visibilty
Logging batch information

Modified S3BulkStorage/S3Ops for delete single tile
S3BulkStorage/S3Ops for delete TileRange tile

Not in this push:
BulkDeleteTask for Single and TileRanges
… file

Moved BulkDeleteTaskTests that are idenpendent of DeleteTileRanges into own file
Fixed Nofications with decorator
Fixed Pass through of Tile Object
Refactor of DeleteTile classes
Removed redundent skipCheck fields in DeleteTileObject
Added test for nothing deleted to DeleteTileObjectBulkDeleteTaskTest
Added Bounded tests
Optimized Imports to remove warnings
Prefix term is overloaded, I think they mean path to the key not a prefix for the path to the key in this case.

Removed warnings from s3Ops

Updated code to issue pending deletes.
Prefix term is overloaded, I think they mean path to the key not a prefix for the path to the key in this case.
Fixed bug in MarkPendingDeleteDecorator.
Code was skipping remove of pending delete for deletes that where being rerun after a start
Removed unnecessary checks for pending delete path validity. If they are in valid they should just have 0 elements to delete or throw an exception and be retried.
Fixed unused local variable
Fixed missing an @OverRide annotation
Fixed Array initialization can be written shorter
Formatting from mvn
@alan-geosolutions
Copy link
Contributor Author

Created a newer simplified version for this feature

@alan-geosolutions alan-geosolutions deleted the Truncate_cache_4151 branch April 11, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants