Skip to content

Commit

Permalink
chimera: virdir, return only the file name
Browse files Browse the repository at this point in the history
 Motivation

    Virtual directory listing should return only the file name.

 Result

    this patch fixes the issue and instead of "/parentdir/filename" stem will return only fileNames

    Acked-by: Tigran
    Patch: https://rb.dcache.org/r/14200/
    Target: master
    Require-book: no
  • Loading branch information
mksahakyan committed Jan 11, 2024
1 parent fea615f commit 0b330a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2172,9 +2172,7 @@ protected ChimeraDirectoryEntry innerNext() {

FsInode inode = new FsInode(dir.getFs(), rs.getLong("fileid"),
FsInodeType.INODE, 0);
String path = inode2path(rs.getLong("fileid"), _root);
return new ChimeraDirectoryEntry(path, inode, stat);

return new ChimeraDirectoryEntry(rs.getString("filename"), inode, stat);

} catch (SQLException e) {
LOGGER.error("failed to fetch next entry: {}", e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1742,10 +1742,10 @@ public void testGenerationVirtualdir() throws Exception {
labelname)) {

for (ChimeraDirectoryEntry entry : dirStream) {
fileNames.add(entry.getName());
fileNames.add(entry.getInode().getId());
}
}
assertTrue(fileNames.containsAll(Lists.newArrayList(parentDirName+"/aFile", parentDirName+"/bFile")));
assertTrue(fileNames.containsAll(Lists.newArrayList(inodeA.getId(), inodeB.getId())));
}

@Test
Expand Down

0 comments on commit 0b330a0

Please sign in to comment.