Skip to content

Conversation

beliefer
Copy link
Contributor

@beliefer beliefer commented Mar 24, 2025

What is the purpose of the change

This PR aims to short circuit judgment for create blob storage dir
According to


, there are already existing the blob storage dir.
The original judgment executes baseDir.mkdirs() first, but it returns false. And then we need to execute baseDir.exists().
We can only need execute baseDir.exists() first and short circuit judgment for baseDir.mkdirs().
According to the current code path, I think this is the mainly logic.
And this PR will not lead to any regression even if there exists some corner case.

Brief change log

Short circuit judgment for create blob storage dir

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@flinkbot
Copy link
Collaborator

flinkbot commented Mar 24, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@beliefer
Copy link
Contributor Author

@beliefer
Copy link
Contributor Author

cc @GOODBOY008

baseDir = fallbackStorageDirectory.deref();

if (baseDir.mkdirs() || baseDir.exists()) {
if (baseDir.exists() || baseDir.mkdirs()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first thing that mkdirs() does is call exists(). Can we remove the baseDir.exists()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your reminder. But it let me take a second thinking.
After the second thinking, it's no need to change this line.

@beliefer beliefer closed this Mar 24, 2025
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