Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2421,7 +2421,6 @@ public FileStatus[] innerListStatus(Path f) throws FileNotFoundException,
result.add(files.next());
}
// merge the results. This will update the store as needed

return S3Guard.dirListingUnion(metadataStore, path, result, dirMeta,
allowAuthoritative, ttlTimeProvider);
} else {
Expand Down Expand Up @@ -3810,7 +3809,6 @@ private RemoteIterator<S3ALocatedFileStatus> innerListFiles(Path f, boolean
final PathMetadata pm = metadataStore.get(path, true);
// shouldn't need to check pm.isDeleted() because that will have
// been caught by getFileStatus above.

MetadataStoreListFilesIterator metadataStoreListFilesIterator =
new MetadataStoreListFilesIterator(metadataStore, pm,
allowAuthoritative);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,7 @@ public void put(
final DirListingMetadata meta,
@Nullable final BulkOperationState operationState) throws IOException {
LOG.debug("Saving to table {} in region {}: {}", tableName, region, meta);

// directory path
Path path = meta.getPath();
DDBPathMetadata ddbPathMeta =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,12 @@ public static Collection<String> getAuthoritativePaths(S3AFileSystem fs) {

public static boolean allowAuthoritative(Path p, S3AFileSystem fs,
boolean authMetadataStore, Collection<String> authPaths) {
String haystack = fs.maybeAddTrailingSlash(p.toString());
String haystack = fs.maybeAddTrailingSlash(fs.qualify(p).toString());
if (authMetadataStore) {
return true;
}
if (!authPaths.isEmpty()) {
for (String needle : authPaths) {

if (haystack.startsWith(needle)) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ public void testPrefixVsDirectory() throws Exception {
Path directoryMatch = new Path(testRoot, "/auth/oritative");
assertTrue(S3Guard.allowAuthoritative(directoryMatch, fs,
false, authPaths));

Path unqualifiedMatch = new Path(testRoot.toUri().getPath(), "/auth/oritative");
assertTrue(S3Guard.allowAuthoritative(unqualifiedMatch, fs,
false, authPaths));
} finally {
cleanUpFS(fs);
}
Expand Down