Hadoop Common
  1. Hadoop Common
  2. HADOOP-2413 Is FSNamesystem.fsNamesystemObject unique?
  3. HADOOP-5037

Deprecate FSNamesystem.getFSNamesystem() and change fsNamesystemObject to private

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      HADOOP-2413 involves quite many codes. This is the first step to fix it.

      1. 5037_20090115.patch
        7 kB
        Tsz Wo Nicholas Sze
      2. 5037_20090122.patch
        7 kB
        Tsz Wo Nicholas Sze

        Issue Links

          Activity

          Hide
          Tsz Wo Nicholas Sze added a comment -

          I just committed this.

          Show
          Tsz Wo Nicholas Sze added a comment - I just committed this.
          Hide
          Tsz Wo Nicholas Sze added a comment -
               [exec] +1 overall.  
               [exec] 
               [exec]     +1 @author.  The patch does not contain any @author tags.
               [exec] 
               [exec]     +1 tests included.  The patch appears to include 3 new or modified tests.
               [exec] 
               [exec]     +1 javadoc.  The javadoc tool did not generate any warning messages.
               [exec] 
               [exec]     +1 javac.  The applied patch does not increase the total number of javac compiler warnings.
               [exec] 
               [exec]     +1 findbugs.  The patch does not introduce any new Findbugs warnings.
               [exec] 
               [exec]     +1 Eclipse classpath. The patch retains Eclipse classpath integrity.
          

          Passed all tests locally except for TestMapReduceLocal (HADOOP-4907).

          Show
          Tsz Wo Nicholas Sze added a comment - [exec] +1 overall. [exec] [exec] +1 @author. The patch does not contain any @author tags. [exec] [exec] +1 tests included. The patch appears to include 3 new or modified tests. [exec] [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings. [exec] [exec] +1 Eclipse classpath. The patch retains Eclipse classpath integrity. Passed all tests locally except for TestMapReduceLocal ( HADOOP-4907 ).
          Hide
          Tsz Wo Nicholas Sze added a comment -

          5037_20090122.patch: added javadoc for the deprecated tag.

          Show
          Tsz Wo Nicholas Sze added a comment - 5037_20090122.patch: added javadoc for the deprecated tag.
          Hide
          Konstantin Shvachko added a comment -
          1. @deprecated comment should say what method should be used instead of that one or why it was deprecated if nothing.
            The rest looks good.
            +1
          Show
          Konstantin Shvachko added a comment - @deprecated comment should say what method should be used instead of that one or why it was deprecated if nothing. The rest looks good. +1
          Hide
          Tsz Wo Nicholas Sze added a comment -

          5037_20090115.patch: fixed the problem. I also changed the fields declared in FSNamesystemMetrics to private final.

          Show
          Tsz Wo Nicholas Sze added a comment - 5037_20090115.patch: fixed the problem. I also changed the fields declared in FSNamesystemMetrics to private final.
          Hide
          Steve Loughran added a comment -

          This method appears in the stack trace of the HADOOP-5021 bug, where FSEditLog has a static method that assumes that there is a single name system that is never null and whose .dir field is always valid
          {{
          static int loadFSEdits(EditLogInputStream edits) throws IOException {
          FSNamesystem fsNamesys = FSNamesystem.getFSNamesystem();
          FSDirectory fsDir = fsNamesys.dir;
          ...
          }}

          FSImage seems to abuse the singleton through its code a lot; it should really be be bound to an FSNameSystem in the constructor; the static method extended to take it as a parameter

          Show
          Steve Loughran added a comment - This method appears in the stack trace of the HADOOP-5021 bug, where FSEditLog has a static method that assumes that there is a single name system that is never null and whose .dir field is always valid {{ static int loadFSEdits(EditLogInputStream edits) throws IOException { FSNamesystem fsNamesys = FSNamesystem.getFSNamesystem(); FSDirectory fsDir = fsNamesys.dir; ... }} FSImage seems to abuse the singleton through its code a lot; it should really be be bound to an FSNameSystem in the constructor; the static method extended to take it as a parameter

            People

            • Assignee:
              Tsz Wo Nicholas Sze
              Reporter:
              Tsz Wo Nicholas Sze
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development