Author: hairong
Date: Tue Oct 13 21:56:17 2009
New Revision: 824944
URL: http://svn.apache.org/viewvc?rev=824944&view=rev
Log:
HDFS-686. NullPointerException is thrown while merging edit log and image.
Contributed by Hairong Kuang.
Modified:
hadoop/hdfs/trunk/CHANGES.txt
hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Modified: hadoop/hdfs/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=824944&r1=824943&r2=824944&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Tue Oct 13 21:56:17 2009
@@ -397,6 +397,13 @@
HDFS-673. BlockReceiver#PacketResponder should not remove a packet from
the ack queue before its ack is sent. (hairong)
+Release 0.20.2 - Unreleased
+
+ BUG FIXES
+
+ HDFS-686. NullPointerException is thrown while merging edit log and image.
+ (hairong)
+
Release 0.20.1 - 2009-09-01
IMPROVEMENTS
Modified:
hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=824944&r1=824943&r2=824944&view=diff
==============================================================================
---
hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
(original)
+++
hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Tue Oct 13 21:56:17 2009
@@ -700,10 +700,7 @@
if (length < 0) {
throw new IOException("Negative length is not supported. File: " + src );
}
- INodeFile inode = dir.getFileINode(src);
- if (inode == null)
- throw new FileNotFoundException();
- final LocatedBlocks ret = getBlockLocationsInternal(src, inode,
+ final LocatedBlocks ret = getBlockLocationsInternal(src,
offset, length, doAccessTime);
if (auditLog.isInfoEnabled()) {
logAuditEvent(UserGroupInformation.getCurrentUGI(),
@@ -714,11 +711,13 @@
}
private synchronized LocatedBlocks getBlockLocationsInternal(String src,
- INodeFile inode,
long offset,
long length,
boolean doAccessTime
) throws IOException {
+ INodeFile inode = dir.getFileINode(src);
+ if (inode == null)
+ throw new FileNotFoundException();
if (doAccessTime && isAccessTimeSupported()) {
dir.setTimes(src, inode, -1, now(), false);
}