Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-3254

FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.18.0
    • None
    • None

    Description

      In FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList), xferResults initially equals to Object[]

      { null, null}

      . If there are blocks to be replicated, xferResults[0] and xferResults[1] will be set to a Block[] and DatanodeInfo[][], respectively. The caller of gotHeartbeat will cast these object to the original classes. For example, in NameNode.sendHeartbeat(...),

          if (xferResults[0] != null) {
            assert(deleteList[0] == null);
            return new BlockCommand((Block[]) xferResults[0], (DatanodeInfo[][]) xferResults[1]);
          }
      

      The use of deleteList is similar.

      Attachments

        1. 3254_20080414.patch
          11 kB
          Tsz-wo Sze

        Issue Links

          Activity

            People

              szetszwo Tsz-wo Sze
              szetszwo Tsz-wo Sze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: