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

infoPort field should be a DatanodeID member

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.4.0
    • 0.5.0
    • None
    • None

    Description

      I have a couple of comments on HADOOP-375. Sorry missed that discussion when the patch was under construction.
      1) As it is done now infoPort is a member of two classes DatanodeInfo and DatanodeRegistration, which in fact have a
      common base DatanodeID. It seems more logical to place infoPort into DatanodeID. This will let us handle the port
      assignments inside the constructors rather than outside, and will prevent from unsafe "dynamic casts" like the one
      found in FSNamesystem.gotHeartbeat( DatanodeID nodeID, ... )
      nodeinfo.infoPort = ((DatanodeRegistration)nodeID).infoPort;
      2) Also, should we make infoPort short rather than integer?
      Since it is a part of a heartbeat message we might want keeping it small.
      3) Member getters should start with get<MemberName>

      • public int infoPort() { return infoPort; }
        + public int getInfoPort() { return infoPort; }

      Attachments

        1. refactor_infoport.patch
          10 kB
          Devaraj Das

        Issue Links

          Activity

            People

              ddas Devaraj Das
              shv Konstantin Shvachko
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: