Skip to content

STAR-933 Add methods to PathUtils need for serverless#288

Merged
djatnieks merged 1 commit intods-trunkfrom
STAR-933
Nov 25, 2021
Merged

STAR-933 Add methods to PathUtils need for serverless#288
djatnieks merged 1 commit intods-trunkfrom
STAR-933

Conversation

@djatnieks
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member

@k-rus k-rus left a comment

Choose a reason for hiding this comment

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

I suggest to fix the patch so it follows existing code in the file and remove unnecessary code duplication.

I also suggest to provide a meaningful commit message. Note that the discussion in the ticket doesn't really help to understand this patch.

I hope you are also looking to add new API to tests.

Comment thread src/java/org/apache/cassandra/io/util/PathUtils.java Outdated
Comment thread src/java/org/apache/cassandra/io/util/PathUtils.java Outdated
Comment thread src/java/org/apache/cassandra/io/util/PathUtils.java Outdated
@djatnieks
Copy link
Copy Markdown
Member Author

I also suggest to provide a meaningful commit message. Note that the discussion in the ticket doesn't really help to understand this patch.

Sure, I will update the commit message when squashing; I could perhaps describe the methods added:

  • Add deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
  • Add listPaths methods to list all the paths in a directory, optionally using a provided filter.

Suggestions welcome.

@k-rus
Copy link
Copy Markdown
Member

k-rus commented Nov 23, 2021

Sure, I will update the commit message when squashing; I could perhaps describe the methods added:

  • Add deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
  • Add listPaths methods to list all the paths in a directory, optionally using a provided filter.

Suggestions welcome.

It is good together with the current PR subject. So it is clear that the commit adds new API functions for the serverless/AstraDB need.

Copy link
Copy Markdown
Member

@k-rus k-rus left a comment

Choose a reason for hiding this comment

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

LGTM
I have just two requests:

  • Can you update PR message with the commit message to be used on squash?
  • Can you update comments for new API functions, so they follow the documentation standard?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know if it is expected to always have a new line at the end of file or not. Here it is missing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

My understanding is a new line is expected, so I will add it

Comment on lines 339 to 342
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should the comment follow the javadoc pattern as in all other methods as it is part of API?

Comment on lines 126 to 127
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am wonder if the reason for this check is an assumption that default file system stored in filesystem can be used in and is used in several API functions. If the file system is different from default, should the API functions not rely on the default? If I understood correctly, the default file system is used for getPath.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This check prevents File being able to wrap a remote filesystem path; that is why the check is removed.
My checking of the uses of filesystem are:

  • in constructors when a Path is not provided
  • in pathSeparator(); this is potential issue, however all known filesystem implementations currently use the same separator value (/)
  • in toPath() only when path is null

There is also some comment about this in the jira.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apache Cassandra requires to specify each imported package explicitly, but it is not forced yet.

Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

85.4% 85.4% Coverage
0.0% 0.0% Duplication

@djatnieks djatnieks merged commit 4f1c86b into ds-trunk Nov 25, 2021
@djatnieks djatnieks deleted the STAR-933 branch November 25, 2021 21:12
jacek-lewandowski pushed a commit that referenced this pull request Mar 8, 2022
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
jacek-lewandowski pushed a commit that referenced this pull request Mar 9, 2022
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
jacek-lewandowski pushed a commit that referenced this pull request Mar 27, 2022
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
jacek-lewandowski pushed a commit that referenced this pull request May 26, 2022
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
jacek-lewandowski pushed a commit that referenced this pull request May 27, 2022
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
jacek-lewandowski pushed a commit that referenced this pull request Oct 17, 2022
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
jacek-lewandowski pushed a commit that referenced this pull request Oct 18, 2022
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
mfleming pushed a commit that referenced this pull request Jul 10, 2023
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
djatnieks added a commit that referenced this pull request Jul 24, 2023
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
djatnieks added a commit that referenced this pull request Aug 22, 2023
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)
djatnieks added a commit that referenced this pull request Sep 12, 2023
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)
jacek-lewandowski pushed a commit that referenced this pull request Jan 28, 2024
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)
djatnieks added a commit that referenced this pull request Mar 29, 2024
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)

STAR-933 Fix PathUtilsTest with initialization of DatabaseDescriptor

STAR-933 Add Descriptor.validFilenameWithComponent expected by CNDB
djatnieks added a commit that referenced this pull request Apr 1, 2024
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)

STAR-933 Fix PathUtilsTest with initialization of DatabaseDescriptor

STAR-933 Add Descriptor.validFilenameWithComponent expected by CNDB
djatnieks added a commit that referenced this pull request Apr 16, 2024
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)

STAR-933 Fix PathUtilsTest with initialization of DatabaseDescriptor

STAR-933 Add Descriptor.validFilenameWithComponent expected by CNDB
djatnieks added a commit that referenced this pull request Jan 30, 2025
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)

STAR-933 Fix PathUtilsTest with initialization of DatabaseDescriptor

STAR-933 Add Descriptor.validFilenameWithComponent expected by CNDB
djatnieks added a commit that referenced this pull request May 18, 2025
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)

STAR-933 Fix PathUtilsTest with initialization of DatabaseDescriptor

STAR-933 Add Descriptor.validFilenameWithComponent expected by CNDB
michaelsembwever pushed a commit that referenced this pull request Feb 6, 2026
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)

STAR-933 Fix PathUtilsTest with initialization of DatabaseDescriptor

STAR-933 Add Descriptor.validFilenameWithComponent expected by CNDB
michaelsembwever pushed a commit that referenced this pull request Feb 10, 2026
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)

STAR-933 Fix PathUtilsTest with initialization of DatabaseDescriptor

STAR-933 Add Descriptor.validFilenameWithComponent expected by CNDB

 (Rebase of commit a3c3f18)
michaelsembwever pushed a commit that referenced this pull request Feb 11, 2026
Add methods to PathUtils:
* deleteContent method that recursively deletes the contents of a directory, leaving the directory empty;
* listPaths methods to list all the paths in a directory, optionally using a provided filter.
Add method to Descriptor:
* validFilenameWithComponent to return the Component from an sstable file name

(cherry picked from commit 4f1c86b)
(cherry picked from commit ef840e5)
(cherry picked from commit dc75ab6)
(cherry picked from commit a5a4794)
(cherry picked from commit 1570f19)

STAR-933 Fix PathUtilsTest with initialization of DatabaseDescriptor

STAR-933 Add Descriptor.validFilenameWithComponent expected by CNDB

 (Rebase of commit a3c3f18)
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