hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r390213 - /lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java
Date Thu, 30 Mar 2006 18:46:37 GMT
Author: cutting
Date: Thu Mar 30 10:46:35 2006
New Revision: 390213

URL: http://svn.apache.org/viewcvs?rev=390213&view=rev
Log:
Fix for HADOOP-84.  Improve error and log messages when block cannot be obtained by including
file name and offset.  Also removed a few unused variables.  Contributed by Konstantin Shvachko.

Modified:
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java?rev=390213&r1=390212&r2=390213&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java Thu Mar 30 10:46:35
2006
@@ -261,7 +261,6 @@
 
         private String src;
         private DataInputStream blockStream;
-        private DataOutputStream partnerStream;
         private Block blocks[] = null;
         private DatanodeInfo nodes[][] = null;
         private long pos = 0;
@@ -274,7 +273,6 @@
             this.src = src;
             openInfo();
             this.blockStream = null;
-            this.partnerStream = null;
             for (int i = 0; i < blocks.length; i++) {
                 this.filelen += blocks[i].getNumBytes();
             }
@@ -358,11 +356,13 @@
                     chosenNode = bestNode(nodes[targetBlock], deadNodes);
                     targetAddr = DataNode.createSocketAddr(chosenNode.getName().toString());
                 } catch (IOException ie) {
+                    String blockInfo =
+                      blocks[targetBlock]+" file="+src+" offset="+target;
                     if (failures >= MAX_BLOCK_ACQUIRE_FAILURES) {
-                        throw new IOException("Could not obtain block " + blocks[targetBlock]);
+                        throw new IOException("Could not obtain block: " + blockInfo);
                     }
                     if (nodes[targetBlock] == null || nodes[targetBlock].length == 0) {
-                        LOG.info("No node available for block " + blocks[targetBlock]);
+                        LOG.info("No node available for block: " + blockInfo);
                     }
                     LOG.info("Could not obtain block from any node:  " + ie);
                     try {
@@ -404,7 +404,6 @@
                     this.pos = target;
                     this.blockEnd = targetBlockEnd;
                     this.blockStream = in;
-                    this.partnerStream = out;
                 } catch (IOException ex) {
                     // Put chosen node into dead list, continue
                     LOG.info("Failed to connect to " + targetAddr + ":" + ex);
@@ -535,7 +534,6 @@
         private File backupFile;
         private OutputStream backupStream;
         private Block block;
-        private DatanodeInfo targets[]; 
         private long filePos = 0;
         private int bytesWrittenToBlock = 0;
 



Mime
View raw message