Skip to content

[jindo] Extract doDelete() template method from HadoopCompliantFileIO#7668

Merged
JingsongLi merged 1 commit intoapache:masterfrom
sundapeng:feature/fileio-before-delete-hook
Apr 20, 2026
Merged

[jindo] Extract doDelete() template method from HadoopCompliantFileIO#7668
JingsongLi merged 1 commit intoapache:masterfrom
sundapeng:feature/fileio-before-delete-hook

Conversation

@sundapeng
Copy link
Copy Markdown
Member

@sundapeng sundapeng commented Apr 18, 2026

Purpose

Refactor HadoopCompliantFileIO.delete() to delegate to a new protected doDelete(Path, boolean) template method. This allows subclasses (e.g. JindoFileIO) to intercept delete operations (trash/recycle-bin, audit logging, etc.) while retaining access to the real filesystem delete via doDelete().

Changes

  • Extract filesystem delete logic into protected doDelete(Path, boolean)
  • delete() now delegates to doDelete() — no behavior change for existing code
  • Subclasses can override delete() with custom logic and call doDelete() for the actual delete

Tests

  • Unit tests verifying the template method pattern works correctly

API and Format

No API or storage format changes.

Documentation

No documentation changes needed.

Refactor delete() to delegate to a protected doDelete() method.
Subclasses can override delete() with custom logic and call doDelete()
when they need the real filesystem delete.
@sundapeng sundapeng closed this Apr 19, 2026
@sundapeng sundapeng reopened this Apr 19, 2026
@XiaoHongbo-Hope
Copy link
Copy Markdown
Contributor

+1

@JingsongLi JingsongLi merged commit c8a0d2a into apache:master Apr 20, 2026
23 of 24 checks passed
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.

3 participants