Skip to content

Addendum for Export Refactoring PR - #12594

Draft
poikilotherm wants to merge 17 commits into
IQSS:11405-refactor-exportsfrom
poikilotherm:11405-addendum
Draft

Addendum for Export Refactoring PR#12594
poikilotherm wants to merge 17 commits into
IQSS:11405-refactor-exportsfrom
poikilotherm:11405-addendum

Conversation

@poikilotherm

Copy link
Copy Markdown
Contributor

No description provided.

…istryBean IQSS#11405

- Moved exporter management logic into a dedicated `ExporterRegistryBean` singleton for improved modularity and maintainability.
- Simplified `ExportService` to delegate exporter logic to the new registry.
- Enable injectingthe registry and other components
- The export process itself is stateless. State is involved in potential write locks, the loaded plugins, etc.
- A stateless coordinator bean scales better for multiple export requests coming in.
…alidator, and storage abstraction IQSS#11405

The goal is removing the caching logic from the ExportService. At the same time, a distinct caching subsystem shall have policies about what gets cached, when it expires etc, all independent of a coordinating service like ExportService.

This make cognitive loader smaller and allows extension without using more code branches.
…eIOCache class IQSS#11405

- Reorganized export cache handling into a dedicated `StorageIOCache` service, improving modularity and reducing cognitive load in `ExportService`.
- Streamlined caching operations with a unified approach across all storage drivers.
- Deprecated legacy unversioned cache keys; introduced versioned aux tag schema for better cache qualification.
- Enhanced write atomicity and cache eviction logic.
- Remove stale code for size of exports
…OCache IQSS#11405

The legacy reading of cached exports is prone to produce bugs in production.

When we rely on reading cached exports as prerequisites for other metadata formats, we might end up with stale data. Any export has no knowledge about whether and when an export of another format happened. We keep no provenance per format.

Assuming there is a cached "latest" with the legacy file format, it would be read as a prerequisite format, but our invalidation mechanisms would not be able to tell if it's actually stale, because it was not yet re-exported.

Any released version is immutable, thus if we rely in lookups on cached objects with the version present in the aux tag, we can be sure we get the latest data.
…constructor

- Added null and blank checks for dataset, version, and formatName to ensure robust usage.
- Introduced a convenience constructor for creating cache keys directly from a dataset version and format.
@poikilotherm poikilotherm self-assigned this Aug 7, 2026
…rvice` package and rename `ExportService` to `ExportServiceBean`

- "ExportServiceBean" is more aligned with the codebase style where EJBs mostly have a "Bean" name suffix.
- Also move test classes into the same package (under the test source tree)
…1405

- Documented `tryRead`, `deleteQuietly`, and `storageFor` with proper Javadoc.
- Clarified the stream-closing intent in `write` to make the leak-avoidance pattern explicit.
…to ExportServiceBean IQSS#11405

- Relocated the `invalidators` collection from the sealed interface to the service bean, where it logically belongs as a runtime dependency rather than a static on the contract.
- Added a section marker for export data retrieval methods in `ExportServiceBean`.
- Noted future plan to replace the static list with a registry pattern once plugins can supply their own invalidation logic.
…tServiceBean

Making it simpler to read inline.
Added `ExportCache` as an CDI (not EJB) injected dependency in the service bean.
- Introduced `clearCachedFormats(DatasetVersion, List<String>)` as the version-specific clearing entry point, with the dataset-level overload delegating via a new `defaultVersion()` helper.
- Added `clearCachedFormat(DatasetVersion, String)` to evict a single cache entry by key.
- Added `requireExists` and `requireAllExist` validation methods to `ExporterRegistryBean` so format names are checked before eviction.
…QSS#11405

Align the related methods into one block, not divided by the cache handling stuff.
…istryBean IQSS#11405

- Added `buildFormatRequiredByMap` to build a read-only map of prerequisite format names to the exporters that depend on them.
- Added `buildAndVerifyRequirements` to validate registry integrity: all prerequisite formats must have a registered exporter, and no cyclic prerequisite chains may exist.
- Integrated the check into initialization as Step 4, failing fast with `ExportException` on any integrity violation (missing prerequisite or cycle).
…#11405

Added `formatRequiredBy` field to store the prerequisite format dependency map alongside the exporters map, populated during registry initialization.

Will be reused during cascaded cache eviction or exporting of formats depending on a certain format.
…#11405

- Added `buildPrerequisitesChainDepth` to compute the prerequisite chain depth for each format (0 = no prerequisite, N = N levels deep).
- Added `buildTopologicalComparator` to create an immutable comparator ordering exporters by depth, with format name as tiebreaker for deterministic results.
- Exposed via `getTopologicalComparator()` so callers can sort the exporter list in a dependency-safe order.
- Integrated as Step 5 in initialization, stored alongside the existing `formatRequiredBy` map.
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.

1 participant