hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r776146 - in /hadoop/core/trunk: ./ src/hdfs/org/apache/hadoop/hdfs/server/common/ src/hdfs/org/apache/hadoop/hdfs/server/datanode/ src/hdfs/org/apache/hadoop/hdfs/server/namenode/
Date Tue, 19 May 2009 01:05:43 GMT
Author: szetszwo
Date: Tue May 19 01:05:43 2009
New Revision: 776146

URL: http://svn.apache.org/viewvc?rev=776146&view=rev
Log:
HADOOP-5829. Fix javac warnings found in ReplicationTargetChooser, FSImage, Checkpointer,
SecondaryNameNode and a few other hdfs classes.  Contributed by Suresh Srinivas

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/InconsistentFSStateException.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/IncorrectVersionException.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/Checkpointer.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseExpiredException.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NotReplicatedYetException.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ReplicationTargetChooser.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SafeModeException.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue May 19 01:05:43 2009
@@ -617,6 +617,10 @@
     HADOOP-5582. Fixes a problem in Hadoop Vaidya to do with reading
     counters from job history files. (Suhas Gogate via ddas)
 
+    HADOOP-5829. Fix javac warnings found in ReplicationTargetChooser,
+    FSImage, Checkpointer, SecondaryNameNode and a few other hdfs classes.
+    (Suresh Srinivas via szetszwo)
+
 Release 0.20.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/InconsistentFSStateException.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/InconsistentFSStateException.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/InconsistentFSStateException.java
(original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/InconsistentFSStateException.java
Tue May 19 01:05:43 2009
@@ -27,6 +27,7 @@
  * 
  */
 public class InconsistentFSStateException extends IOException {
+  private static final long serialVersionUID = 1L;
 
   public InconsistentFSStateException(File dir, String descr) {
     super("Directory " + getFilePath(dir)

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/IncorrectVersionException.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/IncorrectVersionException.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/IncorrectVersionException.java
(original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/common/IncorrectVersionException.java
Tue May 19 01:05:43 2009
@@ -23,10 +23,11 @@
 
 /**
  * The exception is thrown when external version does not match 
- * current version of the appication.
+ * current version of the application.
  * 
  */
 public class IncorrectVersionException extends IOException {
+  private static final long serialVersionUID = 1L;
 
   public IncorrectVersionException(int versionReported, String ofWhat) {
     this(versionReported, ofWhat, FSConstants.LAYOUT_VERSION);

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
(original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
Tue May 19 01:05:43 2009
@@ -957,6 +957,8 @@
   }
   
   public static class Servlet extends HttpServlet {
+    private static final long serialVersionUID = 1L;
+
     public void doGet(HttpServletRequest request, 
                       HttpServletResponse response) throws IOException {
       

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/Checkpointer.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/Checkpointer.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/Checkpointer.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/Checkpointer.java Tue
May 19 01:05:43 2009
@@ -21,6 +21,7 @@
 import java.io.File;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.util.Collection;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -28,6 +29,8 @@
 import org.apache.hadoop.hdfs.protocol.FSConstants;
 import org.apache.hadoop.hdfs.server.common.HdfsConstants.NamenodeRole;
 import org.apache.hadoop.hdfs.server.namenode.FSImage.CheckpointStates;
+import org.apache.hadoop.hdfs.server.namenode.FSImage.NameNodeDirType;
+import org.apache.hadoop.hdfs.server.namenode.FSImage.NameNodeFile;
 import org.apache.hadoop.hdfs.server.protocol.CheckpointCommand;
 import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol;
 import org.apache.hadoop.hdfs.server.protocol.NamenodeCommand;
@@ -165,7 +168,9 @@
   private void downloadCheckpoint(CheckpointSignature sig) throws IOException {
     // Retrieve image file
     String fileid = "getimage=1";
-    File[] files = getFSImage().getImageFiles();
+    Collection<File> list = getFSImage().getFiles(NameNodeFile.IMAGE,
+        NameNodeDirType.IMAGE);
+    File[] files = list.toArray(new File[list.size()]);
     assert files.length > 0 : "No checkpoint targets.";
     String nnHttpAddr = backupNode.nnHttpAddress;
     TransferFsImage.getFileClient(nnHttpAddr, fileid, files);
@@ -174,7 +179,8 @@
 
     // Retrieve edits file
     fileid = "getedit=1";
-    files = getFSImage().getEditsFiles();
+    list = getFSImage().getFiles(NameNodeFile.EDITS, NameNodeDirType.EDITS);
+    files = list.toArray(new File[list.size()]);
     assert files.length > 0 : "No checkpoint targets.";
     TransferFsImage.getFileClient(nnHttpAddr, fileid, files);
     LOG.info("Downloaded file " + files[0].getName() + " size " +

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java Tue May
19 01:05:43 2009
@@ -256,27 +256,6 @@
     return list;
   }
 
-  @Deprecated // Use getFiles() instead
-  File[] getFileNames(NameNodeFile type, NameNodeDirType dirType) {
-    Collection<File> list = getFiles(type, dirType);
-    return list.toArray(new File[list.size()]);
-  }
-
-  @Deprecated
-  File[] getImageFiles() {
-    return getFileNames(NameNodeFile.IMAGE, NameNodeDirType.IMAGE);
-  }
-
-  @Deprecated
-  File[] getEditsFiles() {
-    return getFileNames(NameNodeFile.EDITS, NameNodeDirType.EDITS);
-  }
-
-  @Deprecated // should be removed
-  File[] getTimeFiles() {
-    return getFileNames(NameNodeFile.TIME, null);
-  }
-
   Collection<File> getDirectories(NameNodeDirType dirType) {
     ArrayList<File> list = new ArrayList<File>();
     Iterator<StorageDirectory> it = (dirType == null) ? dirIterator() :

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseExpiredException.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseExpiredException.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseExpiredException.java
(original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseExpiredException.java
Tue May 19 01:05:43 2009
@@ -24,6 +24,8 @@
  * The lease that was being used to create this file has expired.
  */
 public class LeaseExpiredException extends IOException {
+  private static final long serialVersionUID = 1L;
+
   public LeaseExpiredException(String msg) {
     super(msg);
   }

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NotReplicatedYetException.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NotReplicatedYetException.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NotReplicatedYetException.java
(original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NotReplicatedYetException.java
Tue May 19 01:05:43 2009
@@ -24,6 +24,8 @@
  * The file has not finished being written to enough datanodes yet.
  */
 public class NotReplicatedYetException extends IOException {
+  private static final long serialVersionUID = 1L;
+
   public NotReplicatedYetException(String msg) {
     super(msg);
   }

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ReplicationTargetChooser.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ReplicationTargetChooser.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ReplicationTargetChooser.java
(original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ReplicationTargetChooser.java
Tue May 19 01:05:43 2009
@@ -47,6 +47,8 @@
   }
     
   private static class NotEnoughReplicasException extends Exception {
+    private static final long serialVersionUID = 1L;
+
     NotEnoughReplicasException(String msg) {
       super(msg);
     }
@@ -147,24 +149,25 @@
     int numOfResults = results.size();
     boolean newBlock = (numOfResults==0);
     if (writer == null && !newBlock) {
-      writer = (DatanodeDescriptor)results.get(0);
+      writer = results.get(0);
     }
       
     try {
-      switch(numOfResults) {
-      case 0:
+      if (numOfResults == 0) {
         writer = chooseLocalNode(writer, excludedNodes, 
                                  blocksize, maxNodesPerRack, results);
         if (--numOfReplicas == 0) {
-          break;
+          return writer;
         }
-      case 1:
+      }
+      if (numOfResults <= 1) {
         chooseRemoteRack(1, results.get(0), excludedNodes, 
                          blocksize, maxNodesPerRack, results);
         if (--numOfReplicas == 0) {
-          break;
+          return writer;
         }
-      case 2:
+      }
+      if (numOfResults <= 2) {
         if (clusterMap.isOnSameRack(results.get(0), results.get(1))) {
           chooseRemoteRack(1, results.get(0), excludedNodes,
                            blocksize, maxNodesPerRack, results);
@@ -176,12 +179,11 @@
                           maxNodesPerRack, results);
         }
         if (--numOfReplicas == 0) {
-          break;
+          return writer;
         }
-      default:
-        chooseRandom(numOfReplicas, NodeBase.ROOT, excludedNodes, 
-                     blocksize, maxNodesPerRack, results);
       }
+      chooseRandom(numOfReplicas, NodeBase.ROOT, excludedNodes, 
+                   blocksize, maxNodesPerRack, results);
     } catch (NotEnoughReplicasException e) {
       FSNamesystem.LOG.warn("Not able to place enough replicas, still in need of "
                + numOfReplicas);

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SafeModeException.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SafeModeException.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SafeModeException.java
(original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SafeModeException.java
Tue May 19 01:05:43 2009
@@ -26,6 +26,7 @@
  * 
  */
 public class SafeModeException extends IOException {
+  private static final long serialVersionUID = 1L;
 
   public SafeModeException(String text, FSNamesystem.SafeModeInfo mode ) {
     super(text + ". Name node is in safe mode.\n" + mode.getTurnOffTip());

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java?rev=776146&r1=776145&r2=776146&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
(original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
Tue May 19 01:05:43 2009
@@ -34,6 +34,8 @@
 import org.apache.hadoop.hdfs.DFSUtil.ErrorSimulator;
 import org.apache.hadoop.hdfs.server.common.HdfsConstants;
 import org.apache.hadoop.hdfs.server.common.InconsistentFSStateException;
+import org.apache.hadoop.hdfs.server.namenode.FSImage.NameNodeDirType;
+import org.apache.hadoop.hdfs.server.namenode.FSImage.NameNodeFile;
 import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol;
 import org.apache.hadoop.http.HttpServer;
 import org.apache.hadoop.ipc.RPC;
@@ -237,7 +239,9 @@
 
     // get fsimage
     String fileid = "getimage=1";
-    File[] srcNames = checkpointImage.getImageFiles();
+    Collection<File> list = checkpointImage.getFiles(NameNodeFile.IMAGE,
+        NameNodeDirType.IMAGE);
+    File[] srcNames = list.toArray(new File[list.size()]);
     assert srcNames.length > 0 : "No checkpoint targets.";
     TransferFsImage.getFileClient(fsName, fileid, srcNames);
     LOG.info("Downloaded file " + srcNames[0].getName() + " size " +
@@ -245,7 +249,8 @@
 
     // get edits file
     fileid = "getedit=1";
-    srcNames = checkpointImage.getEditsFiles();
+    list = getFSImage().getFiles(NameNodeFile.EDITS, NameNodeDirType.EDITS);
+    srcNames = list.toArray(new File[list.size()]);;
     assert srcNames.length > 0 : "No checkpoint targets.";
     TransferFsImage.getFileClient(fsName, fileid, srcNames);
     LOG.info("Downloaded file " + srcNames[0].getName() + " size " +



Mime
View raw message