HDFS-4954. In nfs, OpenFileCtx.getFlushedOffset() should handle IOException. Contributed by Brandon Li
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1499321 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9c097d8817
commit
4bcf0eb51a
@ -178,7 +178,7 @@ public long getNextOffset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get flushed offset. Note that flushed data may not be persisted.
|
// Get flushed offset. Note that flushed data may not be persisted.
|
||||||
private long getFlushedOffset() {
|
private long getFlushedOffset() throws IOException {
|
||||||
return fos.getPos();
|
return fos.getPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -515,7 +515,13 @@ private int checkCommitInternal(long commitOffset) {
|
|||||||
commitOffset = getNextOffsetUnprotected();
|
commitOffset = getNextOffsetUnprotected();
|
||||||
}
|
}
|
||||||
|
|
||||||
long flushed = getFlushedOffset();
|
long flushed = 0;
|
||||||
|
try {
|
||||||
|
flushed = getFlushedOffset();
|
||||||
|
} catch (IOException e) {
|
||||||
|
LOG.error("Can't get flushed offset, error:" + e);
|
||||||
|
return COMMIT_ERROR;
|
||||||
|
}
|
||||||
LOG.info("getFlushedOffset=" + flushed + " commitOffset=" + commitOffset);
|
LOG.info("getFlushedOffset=" + flushed + " commitOffset=" + commitOffset);
|
||||||
if (flushed < commitOffset) {
|
if (flushed < commitOffset) {
|
||||||
// Keep stream active
|
// Keep stream active
|
||||||
|
@ -444,6 +444,9 @@ Release 2.1.0-beta - 2013-07-02
|
|||||||
HDFS-4943. WebHdfsFileSystem does not work when original file path has
|
HDFS-4943. WebHdfsFileSystem does not work when original file path has
|
||||||
encoded chars. (Jerry He via szetszwo)
|
encoded chars. (Jerry He via szetszwo)
|
||||||
|
|
||||||
|
HDFS-4954. In nfs, OpenFileCtx.getFlushedOffset() should handle IOException.
|
||||||
|
(Brandon Li via szetszwo)
|
||||||
|
|
||||||
BREAKDOWN OF HDFS-347 SUBTASKS AND RELATED JIRAS
|
BREAKDOWN OF HDFS-347 SUBTASKS AND RELATED JIRAS
|
||||||
|
|
||||||
HDFS-4353. Encapsulate connections to peers in Peer and PeerServer classes.
|
HDFS-4353. Encapsulate connections to peers in Peer and PeerServer classes.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user