hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "qianyu (JIRA)" <j...@apache.org>
Subject [jira] Created: (HADOOP-6085) Why open method in class DFSClient would compare old LocatedBlocks and new LocatedBlocks?
Date Fri, 19 Jun 2009 01:29:07 GMT
Why open method in class DFSClient would compare old LocatedBlocks and new LocatedBlocks?
-----------------------------------------------------------------------------------------

                 Key: HADOOP-6085
                 URL: https://issues.apache.org/jira/browse/HADOOP-6085
             Project: Hadoop Core
          Issue Type: Wish
          Components: dfs
    Affects Versions: 0.19.0
            Reporter: qianyu
             Fix For: 0.19.2


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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message