HDFS-4315. DNs with multiple BPs can have BPOfferServices fail to start due to unsynchronized map access. Contributed by Aaron T. Myers.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1422780 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aaron Myers 2012-12-17 07:53:35 +00:00
parent 1ad091b214
commit 9c7a53cf3b
3 changed files with 5 additions and 2 deletions

View File

@ -330,6 +330,9 @@ Release 2.0.3-alpha - Unreleased
HDFS-4307. SocketCache should use monotonic time. (Colin Patrick McCabe
via atm)
HDFS-4315. DNs with multiple BPs can have BPOfferServices fail to start
due to unsynchronized map access. (atm)
BREAKDOWN OF HDFS-3077 SUBTASKS
HDFS-3077. Quorum-based protocol for reading and writing edit logs.

View File

@ -26,6 +26,7 @@ import java.io.RandomAccessFile;
import java.nio.channels.FileLock;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@ -78,7 +79,7 @@ public class DataStorage extends Storage {
// BlockPoolStorage is map of <Block pool Id, BlockPoolStorage>
private Map<String, BlockPoolSliceStorage> bpStorageMap
= new HashMap<String, BlockPoolSliceStorage>();
= Collections.synchronizedMap(new HashMap<String, BlockPoolSliceStorage>());
DataStorage() {

View File

@ -56,7 +56,6 @@ public class TestWebHdfsWithMultipleNameNodes {
((Log4JLogger)NameNode.stateChangeLog).getLogger().setLevel(Level.OFF);
((Log4JLogger)LeaseManager.LOG).getLogger().setLevel(Level.OFF);
((Log4JLogger)LogFactory.getLog(FSNamesystem.class)).getLogger().setLevel(Level.OFF);
((Log4JLogger)DataNode.LOG).getLogger().setLevel(Level.OFF);
}
private static final Configuration conf = new HdfsConfiguration();