/** * Find data node by its transfer address * * @return DatanodeDescriptor if found or null otherwise */ public DatanodeDescriptor getDatanodeByXferAddr(String ipAddr, int xferPort) { if (ipAddr==null) { return null; } hostmapLock.readLock().lock(); try { DatanodeDescriptor[] nodes = map.get(ipAddr); // no entry if (nodes== null) { return null; } for(DatanodeDescriptor containedNode:nodes) { if (xferPort == containedNode.getXferPort()) { return containedNode; } } return null; } finally { hostmapLock.readLock().unlock(); } }
/** * Returned information is a JSON representation of map with host name as the * key and value is a map of dead node attribute keys to its values */ @Override // NameNodeMXBean public String getDeadNodes() { final Map<String, Map<String, Object>> info = new HashMap<String, Map<String, Object>>(); final List<DatanodeDescriptor> dead = new ArrayList<DatanodeDescriptor>(); blockManager.getDatanodeManager().fetchDatanodes(null, dead, false); for (DatanodeDescriptor node : dead) { Map<String, Object> innerinfo = ImmutableMap.<String, Object>builder() .put("lastContact", getLastContact(node)) .put("decommissioned", node.isDecommissioned()) .put("adminState", node.getAdminState().toString()) .put("xferaddr", node.getXferAddr()) .build(); info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo); } return JSON.toString(info); }
/** * Returned information is a JSON representation of map with host name as the * key and value is a map of decommissioning node attribute keys to its * values */ @Override // NameNodeMXBean public String getDecomNodes() { final Map<String, Map<String, Object>> info = new HashMap<String, Map<String, Object>>(); final List<DatanodeDescriptor> decomNodeList = blockManager.getDatanodeManager( ).getDecommissioningNodes(); for (DatanodeDescriptor node : decomNodeList) { Map<String, Object> innerinfo = ImmutableMap .<String, Object> builder() .put("xferaddr", node.getXferAddr()) .put("underReplicatedBlocks", node.getLeavingServiceStatus().getUnderReplicatedBlocks()) .put("decommissionOnlyReplicas", node.getLeavingServiceStatus().getOutOfServiceOnlyReplicas()) .put("underReplicateInOpenFiles", node.getLeavingServiceStatus().getUnderReplicatedInOpenFiles()) .build(); info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo); } return JSON.toString(info); }
/** * Returned information is a JSON representation of map with host name of * nodes entering maintenance as the key and value as a map of various node * attributes to its values. */ @Override // NameNodeMXBean public String getEnteringMaintenanceNodes() { final Map<String, Map<String, Object>> nodesMap = new HashMap<String, Map<String, Object>>(); final List<DatanodeDescriptor> enteringMaintenanceNodeList = blockManager.getDatanodeManager().getEnteringMaintenanceNodes(); for (DatanodeDescriptor node : enteringMaintenanceNodeList) { Map<String, Object> attrMap = ImmutableMap .<String, Object> builder() .put("xferaddr", node.getXferAddr()) .put("underReplicatedBlocks", node.getLeavingServiceStatus().getUnderReplicatedBlocks()) .put("maintenanceOnlyReplicas", node.getLeavingServiceStatus().getOutOfServiceOnlyReplicas()) .put("underReplicateInOpenFiles", node.getLeavingServiceStatus().getUnderReplicatedInOpenFiles()) .build(); nodesMap.put(node.getHostName() + ":" + node.getXferPort(), attrMap); } return JSON.toString(nodesMap); }
innerinfo.put("upgradeDomain", node.getUpgradeDomain()); info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo.build());
/** * Find data node by its transfer address * * @return DatanodeDescriptor if found or null otherwise */ public DatanodeDescriptor getDatanodeByXferAddr(String ipAddr, int xferPort) { if (ipAddr==null) { return null; } hostmapLock.readLock().lock(); try { DatanodeDescriptor[] nodes = map.get(ipAddr); // no entry if (nodes== null) { return null; } for(DatanodeDescriptor containedNode:nodes) { if (xferPort == containedNode.getXferPort()) { return containedNode; } } return null; } finally { hostmapLock.readLock().unlock(); } }
/** * Find data node by its transfer address * * @return DatanodeDescriptor if found or null otherwise */ public DatanodeDescriptor getDatanodeByXferAddr(String ipAddr, int xferPort) { if (ipAddr==null) { return null; } hostmapLock.readLock().lock(); try { DatanodeDescriptor[] nodes = map.get(ipAddr); // no entry if (nodes== null) { return null; } for(DatanodeDescriptor containedNode:nodes) { if (xferPort == containedNode.getXferPort()) { return containedNode; } } return null; } finally { hostmapLock.readLock().unlock(); } }
/** * Returned information is a JSON representation of map with host name as the * key and value is a map of dead node attribute keys to its values */ @Override // NameNodeMXBean public String getDeadNodes() { final Map<String, Map<String, Object>> info = new HashMap<String, Map<String, Object>>(); final List<DatanodeDescriptor> dead = new ArrayList<DatanodeDescriptor>(); blockManager.getDatanodeManager().fetchDatanodes(null, dead, false); for (DatanodeDescriptor node : dead) { Map<String, Object> innerinfo = ImmutableMap.<String, Object>builder() .put("lastContact", getLastContact(node)) .put("decommissioned", node.isDecommissioned()) .put("xferaddr", node.getXferAddr()) .build(); info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo); } return JSON.toString(info); }
/** * Returned information is a JSON representation of map with host name as the * key and value is a map of decommissioning node attribute keys to its * values */ @Override // NameNodeMXBean public String getDecomNodes() { final Map<String, Map<String, Object>> info = new HashMap<String, Map<String, Object>>(); final List<DatanodeDescriptor> decomNodeList = blockManager.getDatanodeManager( ).getDecommissioningNodes(); for (DatanodeDescriptor node : decomNodeList) { Map<String, Object> innerinfo = ImmutableMap .<String, Object> builder() .put("xferaddr", node.getXferAddr()) .put("underReplicatedBlocks", node.decommissioningStatus.getUnderReplicatedBlocks()) .put("decommissionOnlyReplicas", node.decommissioningStatus.getDecommissionOnlyReplicas()) .put("underReplicateInOpenFiles", node.decommissioningStatus.getUnderReplicatedInOpenFiles()) .build(); info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo); } return JSON.toString(info); }
volumeFailureSummary.getEstimatedCapacityLostTotal()); info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo.build());
/** * Returned information is a JSON representation of map with host name as the * key and value is a map of dead node attribute keys to its values */ @Override // NameNodeMXBean public String getDeadNodes() { final Map<String, Map<String, Object>> info = new HashMap<String, Map<String, Object>>(); final List<DatanodeDescriptor> dead = new ArrayList<DatanodeDescriptor>(); blockManager.getDatanodeManager().fetchDatanodes(null, dead, false); for (DatanodeDescriptor node : dead) { Map<String, Object> innerinfo = ImmutableMap.<String, Object>builder() .put("lastContact", getLastContact(node)) .put("decommissioned", node.isDecommissioned()) .put("xferaddr", node.getXferAddr()) .build(); info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo); } return JSON.toString(info); }
/** * Returned information is a JSON representation of map with host name as the * key and value is a map of decommissioning node attribute keys to its * values */ @Override // NameNodeMXBean public String getDecomNodes() { final Map<String, Map<String, Object>> info = new HashMap<String, Map<String, Object>>(); final List<DatanodeDescriptor> decomNodeList = blockManager.getDatanodeManager( ).getDecommissioningNodes(); for (DatanodeDescriptor node : decomNodeList) { Map<String, Object> innerinfo = ImmutableMap .<String, Object> builder() .put("xferaddr", node.getXferAddr()) .put("underReplicatedBlocks", node.decommissioningStatus.getUnderReplicatedBlocks()) .put("decommissionOnlyReplicas", node.decommissioningStatus.getDecommissionOnlyReplicas()) .put("underReplicateInOpenFiles", node.decommissioningStatus.getUnderReplicatedInOpenFiles()) .build(); info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo); } return JSON.toString(info); }
volumeFailureSummary.getEstimatedCapacityLostTotal()); info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo.build());