Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Reviewed
Description
https://builds.apache.org/job/Hadoop-Hdfs-trunk/lastCompletedBuild/testReport/
java.lang.ClassCastException: org.apache.hadoop.hdfs.protocol.HdfsFileStatus cannot be cast to org.apache.hadoop.hdfs.protocol.HdfsLocatedFileStatus
at org.apache.hadoop.hdfs.DistributedFileSystem$1.hasNext(DistributedFileSystem.java:452)
at org.apache.hadoop.fs.FileSystem$5.hasNext(FileSystem.java:1551)
at org.apache.hadoop.fs.FileSystem$5.next(FileSystem.java:1581)
at org.apache.hadoop.fs.FileSystem$5.next(FileSystem.java:1541)
at org.apache.hadoop.fs.TestListFiles.testDirectory(TestListFiles.java:146)
I just debugged the failure
Following is the initial analysis:
Previous behaviour of getListing in ClientNamenodeProtocolTranslatorR23 is
It will pass needLocation flag as true and server side will be packed empty LocatedBlocks with HdfsLocatedFileStatus object if getBlocations are null and needLocation flag is true. So, cleint will reconstruct the HdfsLocatedFileStatus directly if HdfsfileStatus is instanceOf HdfsLocatedFileStatus.
But with new implementation of protocolBuffers, It is just ignoring the LocatedBlocks are server side if the getBlocklocations are null. At client side, to reconstruct the HDFSFileStatus object, it is depending on locations field. Since there is no locations field here, it is considering HDFSFileStatus as just HDFSFileStatus.
Here test assumes that HDFSFileStatus obj will be type of HdfsLocatedFileStatus and trying cast. This is failing here.