Li Junjun created HDFS-3448: ------------------------------- Summary: CLONE - Why open method in class DFSClient would compare old LocatedBlocks and new LocatedBlocks? Key: HDFS-3448 URL: https://issues.apache.org/jira/browse/HDFS-3448 Project: Hadoop HDFS Issue Type: Wish Reporter: Li Junjun Assignee: Todd Lipcon
This is in the package of org.apache.hadoop.hdfs, DFSClient.openInfo(): if (locatedBlocks != null) { Iterator<LocatedBlock> oldIter = locatedBlocks.getLocatedBlocks().iterator(); Iterator<LocatedBlock> newIter = newInfo.getLocatedBlocks().iterator(); while (oldIter.hasNext() && newIter.hasNext()) { if (! oldIter.next().getBlock().equals(newIter.next().getBlock())) { throw new IOException("Blocklist for " + src + " has changed!"); } } } Why we need compare old LocatedBlocks and new LocatedBlocks, and in what case it happen? Why not "this.locatedBlocks = newInfo" directly? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira