/// <summary>Convert a DatanodeInfo to a Json map.</summary> internal static IDictionary <string, object> ToJsonMap(DatanodeInfo datanodeinfo) { if (datanodeinfo == null) { return(null); } // TODO: Fix storageID IDictionary <string, object> m = new SortedDictionary <string, object>(); m["ipAddr"] = datanodeinfo.GetIpAddr(); // 'name' is equivalent to ipAddr:xferPort. Older clients (1.x, 0.23.x) // expects this instead of the two fields. m["name"] = datanodeinfo.GetXferAddr(); m["hostName"] = datanodeinfo.GetHostName(); m["storageID"] = datanodeinfo.GetDatanodeUuid(); m["xferPort"] = datanodeinfo.GetXferPort(); m["infoPort"] = datanodeinfo.GetInfoPort(); m["infoSecurePort"] = datanodeinfo.GetInfoSecurePort(); m["ipcPort"] = datanodeinfo.GetIpcPort(); m["capacity"] = datanodeinfo.GetCapacity(); m["dfsUsed"] = datanodeinfo.GetDfsUsed(); m["remaining"] = datanodeinfo.GetRemaining(); m["blockPoolUsed"] = datanodeinfo.GetBlockPoolUsed(); m["cacheCapacity"] = datanodeinfo.GetCacheCapacity(); m["cacheUsed"] = datanodeinfo.GetCacheUsed(); m["lastUpdate"] = datanodeinfo.GetLastUpdate(); m["lastUpdateMonotonic"] = datanodeinfo.GetLastUpdateMonotonic(); m["xceiverCount"] = datanodeinfo.GetXceiverCount(); m["networkLocation"] = datanodeinfo.GetNetworkLocation(); m["adminState"] = datanodeinfo.GetAdminState().ToString(); return(m); }