umamaheswararao commented on a change in pull request #2911:
URL: https://github.com/apache/ozone/pull/2911#discussion_r767101216
##########
File path:
hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestOzoneECClient.java
##########
@@ -450,14 +456,28 @@ public void testNodeFailuresWhileWriting(int
numFailureToInject,
out.write(inputChunks[i]);
}
- List<DatanodeDetails> failedDNs = new ArrayList<>();
Map<DatanodeDetails, MockDatanodeStorage> storages =
((MockXceiverClientFactory) factoryStub).getStorages();
- DatanodeDetails[] dnDetails =
- storages.keySet().toArray(new DatanodeDetails[storages.size()]);
- for (int i = 0; i < numFailureToInject; i++) {
- failedDNs.add(dnDetails[i]);
- }
+ List<DatanodeDetails> failedDNs =
Review comment:
How about changing the MockXceiverClientFactory#storage to LinkedHashMap
instead of HashMap?
That should maintain the ordering.
If that does not solve, then I would suggest to move this sorting logic to
getStorages method, so that anybody else invoke also will get in order.
--
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]