You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org> on 2008/06/06 21:38:45 UTC

[jira] Commented: (HADOOP-2413) Is FSNamesystem.fsNamesystemObject unique?

    [ https://issues.apache.org/jira/browse/HADOOP-2413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603150#action_12603150 ] 

Tsz Wo (Nicholas), SZE commented on HADOOP-2413:
------------------------------------------------

The use of this static varible FSNamesystem.fsNamesystemObject induces the following Findbugs warning:

- FSNamesystem:365
[ST] Write to static field from instance method [ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD]
This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice. 


> Is FSNamesystem.fsNamesystemObject unique?
> ------------------------------------------
>
>                 Key: HADOOP-2413
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2413
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.15.1
>            Reporter: Tsz Wo (Nicholas), SZE
>            Priority: Minor
>
> FSNamesystem is unique in almost all cases but it is not universally true.  So we should either remove the static variable FSNamesystem.fsNamesystemObject or make it final (so that it cannot be overwritten).
> When I am working on HADOOP-1298, I use the convenient static method FSNamesystem.getFSNamesystem() to get "the" FSNamesystem object.  However, it keeps failing on TestCheckpoint.  Why?  It is because TestCheckpoint uses NameNode and SecondaryNameNode.  Both of them are creating FSNamesystem.  So FSNamesystem.fsNamesystemObject does not remain constant.  The kind of bug is hard to be detected.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.