/** * Try to send an error report to the NNs associated with the given * block pool. * @param bpid the block pool ID * @param errCode error code to send * @param errMsg textual message to send */ void trySendErrorReport(String bpid, int errCode, String errMsg) { BPOfferService bpos = blockPoolManager.get(bpid); if (bpos == null) { throw new IllegalArgumentException("Bad block pool: " + bpid); } bpos.trySendErrorReport(errCode, errMsg); }
private void handleDiskError(String failedVolumes) { final boolean hasEnoughResources = data.hasEnoughResource(); LOG.warn("DataNode.handleDiskError on: " + "[{}] Keep Running: {}", failedVolumes, hasEnoughResources); // If we have enough active valid volumes then we do not want to // shutdown the DN completely. int dpError = hasEnoughResources ? DatanodeProtocol.DISK_ERROR : DatanodeProtocol.FATAL_DISK_ERROR; metrics.incrVolumeFailures(); //inform NameNodes for(BPOfferService bpos: blockPoolManager.getAllNamenodeThreads()) { bpos.trySendErrorReport(dpError, failedVolumes); } if(hasEnoughResources) { scheduleAllBlockReport(0); return; // do not shutdown } LOG.warn("DataNode is shutting down due to failed volumes: [" + failedVolumes + "]"); shouldRun = false; }
String errStr = "Can't send invalid block " + block; LOG.info(errStr); bpos.trySendErrorReport(DatanodeProtocol.INVALID_BLOCK, errStr); return;
/** * Try to send an error report to the NNs associated with the given * block pool. * @param bpid the block pool ID * @param errCode error code to send * @param errMsg textual message to send */ void trySendErrorReport(String bpid, int errCode, String errMsg) { BPOfferService bpos = blockPoolManager.get(bpid); if (bpos == null) { throw new IllegalArgumentException("Bad block pool: " + bpid); } bpos.trySendErrorReport(errCode, errMsg); }
/** * Try to send an error report to the NNs associated with the given * block pool. * @param bpid the block pool ID * @param errCode error code to send * @param errMsg textual message to send */ void trySendErrorReport(String bpid, int errCode, String errMsg) { BPOfferService bpos = blockPoolManager.get(bpid); if (bpos == null) { throw new IllegalArgumentException("Bad block pool: " + bpid); } bpos.trySendErrorReport(errCode, errMsg); }
private void handleDiskError(String errMsgr) { final boolean hasEnoughResources = data.hasEnoughResource(); LOG.warn("DataNode.handleDiskError: Keep Running: " + hasEnoughResources); // If we have enough active valid volumes then we do not want to // shutdown the DN completely. int dpError = hasEnoughResources ? DatanodeProtocol.DISK_ERROR : DatanodeProtocol.FATAL_DISK_ERROR; metrics.incrVolumeFailures(); //inform NameNodes for(BPOfferService bpos: blockPoolManager.getAllNamenodeThreads()) { bpos.trySendErrorReport(dpError, errMsgr); } if(hasEnoughResources) { scheduleAllBlockReport(0); return; // do not shutdown } LOG.warn("DataNode is shutting down: " + errMsgr); shouldRun = false; }
private void handleDiskError(String errMsgr) { final boolean hasEnoughResources = data.hasEnoughResource(); LOG.warn("DataNode.handleDiskError: Keep Running: " + hasEnoughResources); // If we have enough active valid volumes then we do not want to // shutdown the DN completely. int dpError = hasEnoughResources ? DatanodeProtocol.DISK_ERROR : DatanodeProtocol.FATAL_DISK_ERROR; metrics.incrVolumeFailures(); //inform NameNodes for(BPOfferService bpos: blockPoolManager.getAllNamenodeThreads()) { bpos.trySendErrorReport(dpError, errMsgr); } if(hasEnoughResources) { scheduleAllBlockReport(0); return; // do not shutdown } LOG.warn("DataNode is shutting down: " + errMsgr); shouldRun = false; }
String errStr = "Can't send invalid block " + block; LOG.info(errStr); bpos.trySendErrorReport(DatanodeProtocol.INVALID_BLOCK, errStr); return;
Mockito.anyInt(), Mockito.anyString()); String errorString = "Can't send invalid block " + FAKE_BLOCK; bpos.trySendErrorReport(DatanodeProtocol.INVALID_BLOCK, errorString); bpos.trySendErrorReport(DatanodeProtocol.INVALID_BLOCK, errorString); Thread.sleep(10000); long difference = secondCallTime - firstCallTime;
String errStr = "Can't send invalid block " + block; LOG.info(errStr); bpos.trySendErrorReport(DatanodeProtocol.INVALID_BLOCK, errStr); return;
Mockito.anyInt(), Mockito.anyString()); String errorString = "Can't send invalid block " + FAKE_BLOCK; bpos.trySendErrorReport(DatanodeProtocol.INVALID_BLOCK, errorString); Thread.sleep(10000); assertTrue("Active namenode didn't add the report back to the queue "