[
https://issues.apache.org/jira/browse/HDFS-14853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16933185#comment-16933185
]
Ayush Saxena commented on HDFS-14853:
-------------------------------------
Thanx [~RANith] for the patch. Fix makes sense to me.
For the UT you may use the existing cluster in the Test Class, Something like
this may work :
{code:java}
@Test
public void testChooseRandomWithStorageTypeWithInvalidExcludedNode() {
HashSet<Node> excluded = new HashSet<>();
excluded.add(new DatanodeInfoBuilder()
.setNodeID(DatanodeID.EMPTY_DATANODE_ID).build());
Node node = CLUSTER.chooseRandomWithStorageType("/", "/l1/d1/r1", excluded,
StorageType.ARCHIVE);
assertNotNull(node);
}
{code}
> NPE in DFSNetworkTopology#chooseRandomWithStorageType() when the excludedNode
> is deleted
> ----------------------------------------------------------------------------------------
>
> Key: HDFS-14853
> URL: https://issues.apache.org/jira/browse/HDFS-14853
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Ranith Sardar
> Assignee: Ranith Sardar
> Priority: Major
> Attachments: HDFS-14853.001.patch
>
>
>
> {{org.apache.hadoop.ipc.RemoteException(java.lang.NullPointerException):
> java.lang.NullPointerException
> at
> org.apache.hadoop.hdfs.net.DFSNetworkTopology.chooseRandomWithStorageType(DFSNetworkTopology.java:229)
> at
> org.apache.hadoop.hdfs.net.DFSNetworkTopology.chooseRandomWithStorageType(DFSNetworkTopology.java:77)}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]