HDFS-7570. SecondaryNameNode need twice memory when calling reloadFromImageFile. Contributed by zhaoyunjiong.

This commit is contained in:
cnauroth 2015-01-13 16:10:28 -08:00
parent 10ac5abb86
commit 85aec75ce5
4 changed files with 14 additions and 1 deletions

View File

@ -688,6 +688,9 @@ Release 2.7.0 - UNRELEASED
HDFS-5445. PacketReceiver populates the packetLen field in PacketHeader
incorrectly (Jonathan Mace via Colin P. McCabe)
HDFS-7470. SecondaryNameNode need twice memory when calling
reloadFromImageFile. (zhaoyunjiong via cnauroth)
Release 2.6.1 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -3741,4 +3741,9 @@ public class BlockManager {
stopReplicationInitializer();
blocksMap.close();
}
public void clear() {
clearQueues();
blocksMap.clear();
}
}

View File

@ -86,9 +86,13 @@ class BlocksMap {
void close() {
clear();
blocks = null;
}
void clear() {
if (blocks != null) {
blocks.clear();
blocks = null;
}
}

View File

@ -596,6 +596,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
snapshotManager.clearSnapshottableDirs();
cacheManager.clear();
setImageLoaded(false);
blockManager.clear();
}
@VisibleForTesting