/** Remove a dead datanode. */ void removeDeadDatanode(final DatanodeID nodeID, boolean removeBlocksFromBlockMap) { DatanodeDescriptor d; try { d = getDatanode(nodeID); } catch(IOException e) { d = null; } if (d != null && isDatanodeDead(d)) { NameNode.stateChangeLog.info( "BLOCK* removeDeadDatanode: lost heartbeat from " + d + ", removeBlocksFromBlockMap " + removeBlocksFromBlockMap); removeDatanode(d, removeBlocksFromBlockMap); } }
try { final DatanodeDescriptor dn = datanodeManager. getDatanode(datanodesAndStorages.get(i)); if (dn == null) { continue;
/** * Remove a datanode * @throws UnregisteredNodeException */ public void removeDatanode(final DatanodeID node) throws UnregisteredNodeException { namesystem.writeLock(); try { final DatanodeDescriptor descriptor = getDatanode(node); if (descriptor != null) { removeDatanode(descriptor, true); } else { NameNode.stateChangeLog.warn("BLOCK* removeDatanode: " + node + " does not exist"); } } finally { namesystem.writeUnlock(); } }
public long requestBlockReportLeaseId(DatanodeRegistration nodeReg) { assert namesystem.hasReadLock(); DatanodeDescriptor node = null; try { node = datanodeManager.getDatanode(nodeReg); } catch (UnregisteredNodeException e) { LOG.warn("Unregistered datanode {}", nodeReg); return 0; } if (node == null) { LOG.warn("Failed to find datanode {}", nodeReg); return 0; } // Request a new block report lease. The BlockReportLeaseManager has // its own internal locking. long leaseId = blockReportLeaseManager.requestLease(node); BlockManagerFaultInjector.getInstance(). requestBlockReportLease(node, leaseId); return leaseId; }
LOG.debug("Received handleLifeline from nodeReg = " + nodeReg); DatanodeDescriptor nodeinfo = getDatanode(nodeReg); if (nodeinfo == null || !nodeinfo.isRegistered()) {
continue; final DatanodeDescriptor dd = getDatanode(datanodeID[i]); if (dd != null) { storages[i] = dd.getStorageInfo(storageIDs[i]);
DatanodeDescriptor dnDescriptor = datanodeManager.getDatanode(dn); if (dnDescriptor == null) { LOG.warn("DataNode {} cannot be found with UUID {}" +
/** * The given node is reporting incremental information about some blocks. * This includes blocks that are starting to be received, completed being * received, or deleted. * * This method must be called with FSNamesystem lock held. */ public void processIncrementalBlockReport(final DatanodeID nodeID, final StorageReceivedDeletedBlocks srdb) throws IOException { assert namesystem.hasWriteLock(); final DatanodeDescriptor node = datanodeManager.getDatanode(nodeID); if (node == null || !node.isRegistered()) { blockLog.warn("BLOCK* processIncrementalBlockReport" + " is received from dead or unregistered node {}", nodeID); throw new IOException( "Got incremental block report from unregistered or dead node"); } boolean successful = false; try { processIncrementalBlockReport(node, srdb); successful = true; } finally { if (!successful) { node.setForceRegistration(true); } } }
/** * Get data node by datanode ID. * * @param nodeID datanode ID * @return DatanodeDescriptor or null if the node is not found. * @throws UnregisteredNodeException */ public DatanodeDescriptor getDatanode(DatanodeID nodeID) throws UnregisteredNodeException { final DatanodeDescriptor node = getDatanode(nodeID.getDatanodeUuid()); if (node == null) return null; if (!node.getXferAddr().equals(nodeID.getXferAddr())) { final UnregisteredNodeException e = new UnregisteredNodeException( nodeID, node); NameNode.stateChangeLog.error("BLOCK* NameSystem.getDatanode: " + e.getLocalizedMessage()); throw e; } return node; }
try { final DatanodeDescriptor datanode = blockManager.getDatanodeManager().getDatanode(datanodeID); if (datanode == null || !datanode.isRegistered()) { throw new IOException(
final long size, final long minBlockSize) throws UnregisteredNodeException { final DatanodeDescriptor node = getDatanodeManager().getDatanode(datanode); if (node == null) { blockLog.warn("BLOCK* getBlocks: Asking for blocks from an" +
NumberReplicas nr) throws IOException { blockLog.debug("BLOCK* invalidateBlock: {} on {}", b, dn); DatanodeDescriptor node = getDatanodeManager().getDatanode(dn); if (node == null) { throw new IOException("Cannot invalidate " + b
delHintNode = datanodeManager.getDatanode(delHint); if (delHintNode == null) { blockLog.warn("BLOCK* blockReceived: {} is expected to be removed " +
final DatanodeDescriptor nodeinfo; try { nodeinfo = getDatanode(nodeReg); } catch (UnregisteredNodeException e) { return new DatanodeCommand[]{RegisterCommand.REGISTER};
DatanodeDescriptor node = getDatanodeManager().getDatanode(dn); if (node == null) { throw new IOException("Cannot mark " + blk
public void removeBRLeaseIfNeeded(final DatanodeID nodeID, final BlockReportContext context) throws IOException { namesystem.writeLock(); DatanodeDescriptor node; try { node = datanodeManager.getDatanode(nodeID); if (context != null) { if (context.getTotalRpcs() == context.getCurRpc() + 1) { long leaseId = this.getBlockReportLeaseManager().removeLease(node); BlockManagerFaultInjector.getInstance(). removeBlockReportLease(node, leaseId); node.setLastBlockReportTime(now()); node.setLastBlockReportMonotonic(Time.monotonicNow()); } LOG.debug("Processing RPC with index {} out of total {} RPCs in " + "processReport 0x{}", context.getCurRpc(), context.getTotalRpcs(), Long.toHexString(context.getReportId())); } } finally { namesystem.writeUnlock(); } }
node = datanodeManager.getDatanode(nodeID); if (node == null || !node.isRegistered()) { throw new IOException(
+ nodeReg + " storage " + nodeReg.getDatanodeUuid()); DatanodeDescriptor nodeS = getDatanode(nodeReg.getDatanodeUuid()); DatanodeDescriptor nodeN = host2DatanodeMap.getDatanodeByXferAddr( nodeReg.getIpAddr(), nodeReg.getXferPort());
/** * Return the datanode descriptor for the given datanode. */ public static DatanodeDescriptor getDatanode(final FSNamesystem ns, DatanodeID id) throws IOException { ns.readLock(); try { return ns.getBlockManager().getDatanodeManager().getDatanode(id); } finally { ns.readUnlock(); } }
/** @return the datanode descriptor for the given the given storageID. */ public static DatanodeDescriptor getDatanode(final FSNamesystem ns, final String storageID) { ns.readLock(); try { return ns.getBlockManager().getDatanodeManager().getDatanode(storageID); } finally { ns.readUnlock(); } }