-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
59848: cloudimpl: rework userfile listing’s prefix/pattern matching r=dt a=dt This updates the logic used by userfile’s ListFiles w.r.t. how it choses the prefix of the table to search and how it filters results using the supplied pattern. As before, we list the underlying store using some prefix. However whereas previously this was always the prefix configured for the storage connection, or the prefix of it until the first glob-pattern character, it now is derived from that or additionally from the prefix of the passed in pattern-suffix up to the first pattern character. Thus a prefix of “/a” and a pattern of “b/c/d*.txt” would now list “/a/b/c/d” instead of “/a”. This is obviously more efficient but also makes the behavior more consistent, so that listing “/a/b/c” on a connection with configured prefix of “/“ is now the same as listing “/c“ on a connection with a configured prefix of “/a/b”. As before, if a returned path is contained by the connection’s prefix, which it will be any time the connection prefix does not include a pattern, the relative path, i.e. the suffix, is what is returned, otherwise the fully-qualified path is returned. This logic currently only added to userfile, but is pulled into two helpers which can later be reused in the other ListFiles methods to make this behavior more consistent across implementations. Release note: none. Co-authored-by: David Taylor <[email protected]>
- Loading branch information
Showing
3 changed files
with
127 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.