HDFS-6799. The invalidate method in SimulatedFSDataset failed to remove (invalidate) blocks from the file system. Contributed by Megasthenis Asteris.
This commit is contained in:
parent
7971c97ec1
commit
02adf7185d
|
@ -482,9 +482,10 @@ public class SimulatedFSDataset implements FsDatasetSpi<FsVolumeSpi> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // FsDatasetSpi
|
@Override // FsDatasetSpi
|
||||||
public synchronized void unfinalizeBlock(ExtendedBlock b) {
|
public synchronized void unfinalizeBlock(ExtendedBlock b) throws IOException{
|
||||||
if (isValidRbw(b)) {
|
if (isValidRbw(b)) {
|
||||||
blockMap.remove(b.getLocalBlock());
|
final Map<Block, BInfo> map = getMap(b.getBlockPoolId());
|
||||||
|
map.remove(b.getLocalBlock());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,7 +625,7 @@ public class SimulatedFSDataset implements FsDatasetSpi<FsVolumeSpi> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
storage.free(bpid, binfo.getNumBytes());
|
storage.free(bpid, binfo.getNumBytes());
|
||||||
blockMap.remove(b);
|
map.remove(b);
|
||||||
}
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
throw new IOException("Invalidate: Missing blocks.");
|
throw new IOException("Invalidate: Missing blocks.");
|
||||||
|
|
Loading…
Reference in New Issue