goiri commented on a change in pull request #3415:
URL: https://github.com/apache/hadoop/pull/3415#discussion_r720413175
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterMountTable.java
##########
@@ -356,22 +356,29 @@ public void testGetMountPointStatus() throws IOException {
String child = "testA";
Path childPath = new Path(src, child);
HdfsFileStatus dirStatus =
- clientProtocol.getMountPointStatus(childPath.toString(), 0, 0);
+ clientProtocol.getMountPointStatus(childPath.toString(), 0, 0, true);
assertEquals(child, dirStatus.getLocalName());
String src1 = "/testA";
String child1 = "testB";
Path childPath1 = new Path(src1, child1);
HdfsFileStatus dirStatus1 =
- clientProtocol.getMountPointStatus(childPath1.toString(), 0, 0);
+ clientProtocol.getMountPointStatus(childPath1.toString(), 0, 0, true);
assertEquals(child1, dirStatus1.getLocalName());
String src2 = "/testA/testB";
String child2 = "testC";
Path childPath2 = new Path(src2, child2);
HdfsFileStatus dirStatus2 =
- clientProtocol.getMountPointStatus(childPath2.toString(), 0, 0);
+ clientProtocol.getMountPointStatus(childPath2.toString(), 0, 0, true);
assertEquals(child2, dirStatus2.getLocalName());
+
+ String src3 = "/testA/testB/testC";
+ String child3 = "testD";
+ Path childPath3 = new Path(src3, child3);
+ HdfsFileStatus dirStatus3 =
+ clientProtocol.getMountPointStatus(childPath3.toString(), 0, 0, false);
+ assertTrue(dirStatus3.getLocalName().length() == 0);
Review comment:
assertEquals
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java
##########
@@ -919,10 +919,10 @@ public HdfsFileStatus getFileInfo(String src) throws
IOException {
if (dates != null && dates.containsKey(src)) {
date = dates.get(src);
}
- ret = getMountPointStatus(src, children.size(), date);
+ ret = getMountPointStatus(src, children.size(), date, false);
Review comment:
It looks like false is kind of the exception for this method.
Can we keep the old signature with `true` as the default?
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterMountTable.java
##########
@@ -356,22 +356,29 @@ public void testGetMountPointStatus() throws IOException {
String child = "testA";
Path childPath = new Path(src, child);
HdfsFileStatus dirStatus =
- clientProtocol.getMountPointStatus(childPath.toString(), 0, 0);
+ clientProtocol.getMountPointStatus(childPath.toString(), 0, 0, true);
assertEquals(child, dirStatus.getLocalName());
String src1 = "/testA";
String child1 = "testB";
Path childPath1 = new Path(src1, child1);
HdfsFileStatus dirStatus1 =
- clientProtocol.getMountPointStatus(childPath1.toString(), 0, 0);
+ clientProtocol.getMountPointStatus(childPath1.toString(), 0, 0, true);
assertEquals(child1, dirStatus1.getLocalName());
String src2 = "/testA/testB";
String child2 = "testC";
Path childPath2 = new Path(src2, child2);
HdfsFileStatus dirStatus2 =
- clientProtocol.getMountPointStatus(childPath2.toString(), 0, 0);
+ clientProtocol.getMountPointStatus(childPath2.toString(), 0, 0, true);
assertEquals(child2, dirStatus2.getLocalName());
+
+ String src3 = "/testA/testB/testC";
+ String child3 = "testD";
+ Path childPath3 = new Path(src3, child3);
+ HdfsFileStatus dirStatus3 =
+ clientProtocol.getMountPointStatus(childPath3.toString(), 0, 0, false);
+ assertTrue(dirStatus3.getLocalName().length() == 0);
Review comment:
I think there's also isEmpty() for the string.
Could we also check for some other attribute other than getLocalName()?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]