We may see the following exception:
The cause is that in LocatedBlock.java, when addCachedLoc:
- Passed in parameter loc, which is type DatanodeDescriptor, is added to cachedList
- cachedList was assigned to EMPTY_LOCS, which is type DatanodeInfoWithStorage.
Both DatanodeDescriptor and DatanodeInfoWithStorage are subclasses of DatanodeInfo but do not inherit from each other, resulting in the ArrayStoreException.