Skip to content
Closed
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 @@ -511,9 +511,6 @@ public MountTable getMountPoint(final String path) throws IOException {
public List<String> getMountPoints(final String str) throws IOException {
verifyMountTable();
String path = RouterAdmin.normalizeFileSystemPath(str);
if (isTrashPath(path)) {
path = subtractTrashCurrentPath(path);
}
readLock.lock();
try {
String from = path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,26 @@ public void testSubtractTrashCurrentPath() throws IOException {
assertEquals("/.Trash/Current", MountTableResolver.
subtractTrashCurrentPath("/.Trash/Current"));
}

@Test
public void testListStatusTrashPath() throws IOException, URISyntaxException {
UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
MountTable addEntry1 =
MountTable.newInstance("/user/a", Collections.singletonMap(ns0, "/user/a"));
MountTable addEntry2 =
MountTable.newInstance("/user/b", Collections.singletonMap(ns0, "/user/b"));
assertTrue(addMountTable(addEntry1));
assertTrue(addMountTable(addEntry2));

// Current user client
DFSClient client = nnContext.getClient();
String trashPath = "/user/" + ugi.getShortUserName() + "/.Trash/Current/user/c";
client.mkdirs(trashPath, new FsPermission("777"), true);
assertTrue(client.exists(trashPath));

// Request to the router
String trashPathParent = "/user/" + ugi.getShortUserName() + "/.Trash/Current/user";
FileStatus[] fileStatuses = routerFs.listStatus(new Path(trashPathParent));
assertEquals(1, fileStatuses.length);
}
}