HDFS-4308. addBlock() should persist file blocks once. Contributed by Plamen Jeliazkov.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1426703 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
52742c9a65
commit
6a4b1b881c
|
@ -338,6 +338,9 @@ Release 2.0.3-alpha - Unreleased
|
|||
HDFS-4140. fuse-dfs handles open(O_TRUNC) poorly. (Colin Patrick McCabe
|
||||
via atm)
|
||||
|
||||
HDFS-4308. addBlock() should persist file blocks once.
|
||||
(Plamen Jeliazkov via shv)
|
||||
|
||||
BREAKDOWN OF HDFS-3077 SUBTASKS
|
||||
|
||||
HDFS-3077. Quorum-based protocol for reading and writing edit logs.
|
||||
|
|
|
@ -419,19 +419,16 @@ public class FSDirectory implements Closeable {
|
|||
/**
|
||||
* Remove a block from the file.
|
||||
*/
|
||||
boolean removeBlock(String path, INodeFileUnderConstruction fileNode,
|
||||
void removeBlock(String path, INodeFileUnderConstruction fileNode,
|
||||
Block block) throws IOException {
|
||||
waitForReady();
|
||||
|
||||
writeLock();
|
||||
try {
|
||||
unprotectedRemoveBlock(path, fileNode, block);
|
||||
// write modified block locations to log
|
||||
fsImage.getEditLog().logOpenFile(path, fileNode);
|
||||
} finally {
|
||||
writeUnlock();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void unprotectedRemoveBlock(String path, INodeFileUnderConstruction fileNode,
|
||||
|
|
Loading…
Reference in New Issue