|
@@ -489,6 +489,18 @@ public class DatanodeDescriptor extends DatanodeInfo {
|
|
|
synchronized (storageMap) {
|
|
|
DatanodeStorageInfo storage = storageMap.get(s.getStorageID());
|
|
|
if (null == storage) {
|
|
|
+ LOG.info("Adding new storage ID {} for DN {}", s.getStorageID(),
|
|
|
+ getXferAddr());
|
|
|
+ DFSTopologyNodeImpl parent = null;
|
|
|
+ if (getParent() instanceof DFSTopologyNodeImpl) {
|
|
|
+ parent = (DFSTopologyNodeImpl) getParent();
|
|
|
+ }
|
|
|
+ StorageType type = s.getStorageType();
|
|
|
+ if (!hasStorageType(type) && parent != null) {
|
|
|
+ // we are about to add a type this node currently does not have,
|
|
|
+ // inform the parent that a new type is added to this datanode
|
|
|
+ parent.childAddStorage(getName(), type);
|
|
|
+ }
|
|
|
storageMap.put(s.getStorageID(), s);
|
|
|
} else {
|
|
|
assert storage == s : "found " + storage + " expected " + s;
|