hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tsz Wo (Nicholas), SZE (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HDFS-1217) Some methods in the NameNdoe should not be public
Date Wed, 16 Jun 2010 21:44:23 GMT

    [ https://issues.apache.org/jira/browse/HDFS-1217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12879517#action_12879517
] 

Tsz Wo (Nicholas), SZE commented on HDFS-1217:
----------------------------------------------

Here is some suggestions:
{code}
+++ src/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java	(working copy)
@@ -1137,7 +1137,7 @@
    * @param nodeReg data node registration
    * @throws IOException
    */
-  public void verifyRequest(NodeRegistration nodeReg) throws IOException {
+  void verifyRequest(NodeRegistration nodeReg) throws IOException {
     verifyVersion(nodeReg.getVersion());
     if (!namesystem.getRegistrationID().equals(nodeReg.getRegistrationID()))
       throw new UnregisteredNodeException(nodeReg);
@@ -1149,19 +1149,12 @@
    * @param version
    * @throws IOException
    */
-  public void verifyVersion(int version) throws IOException {
+  private static void verifyVersion(int version) throws IOException {
     if (version != LAYOUT_VERSION)
       throw new IncorrectVersionException(version, "data node");
   }
 
-  /**
-   * Returns the name of the fsImage file
-   */
-  public File getFsImageName() throws IOException {
-    return getFSImage().getFsImageName();
-  }
-    
-  public FSImage getFSImage() {
+  FSImage getFSImage() {
     return namesystem.dir.fsImage;
   }
 
@@ -1169,7 +1162,7 @@
    * Returns the name of the fsImage file uploaded by periodic
    * checkpointing
    */
-  public File[] getFsImageNameCheckpoint() throws IOException {
+  File[] getFsImageNameCheckpoint() throws IOException {
     return getFSImage().getFsImageNameCheckpoint();
   }
 
@@ -1187,7 +1180,7 @@
    * 
    * @return the http address.
    */
-  public InetSocketAddress getHttpAddress() {
+  InetSocketAddress getHttpAddress() {
     return httpAddress;
   }
{code}

> Some methods in the NameNdoe should not be public
> -------------------------------------------------
>
>                 Key: HDFS-1217
>                 URL: https://issues.apache.org/jira/browse/HDFS-1217
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: name-node
>            Reporter: Tsz Wo (Nicholas), SZE
>
> There are quite a few NameNode methods which are not required to be public.

-- 
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