Java Code Examples for org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol#DISK_ERROR

The following examples show how to use org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol#DISK_ERROR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NameNodeRpcServer.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Override // DatanodeProtocol
public void errorReport(DatanodeRegistration nodeReg,
                        int errorCode, String msg) throws IOException { 
  checkNNStartup();
  String dnName = 
     (nodeReg == null) ? "Unknown DataNode" : nodeReg.toString();

  if (errorCode == DatanodeProtocol.NOTIFY) {
    LOG.info("Error report from " + dnName + ": " + msg);
    return;
  }
  verifyRequest(nodeReg);

  if (errorCode == DatanodeProtocol.DISK_ERROR) {
    LOG.warn("Disk error on " + dnName + ": " + msg);
  } else if (errorCode == DatanodeProtocol.FATAL_DISK_ERROR) {
    LOG.warn("Fatal disk error on " + dnName + ": " + msg);
    namesystem.getBlockManager().getDatanodeManager().removeDatanode(nodeReg);            
  } else {
    LOG.info("Error report from " + dnName + ": " + msg);
  }
}
 
Example 2
Source File: DataNode.java    From hadoop with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example 3
Source File: NameNodeRpcServer.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Override // DatanodeProtocol
public void errorReport(DatanodeRegistration nodeReg,
                        int errorCode, String msg) throws IOException { 
  checkNNStartup();
  String dnName = 
     (nodeReg == null) ? "Unknown DataNode" : nodeReg.toString();

  if (errorCode == DatanodeProtocol.NOTIFY) {
    LOG.info("Error report from " + dnName + ": " + msg);
    return;
  }
  verifyRequest(nodeReg);

  if (errorCode == DatanodeProtocol.DISK_ERROR) {
    LOG.warn("Disk error on " + dnName + ": " + msg);
  } else if (errorCode == DatanodeProtocol.FATAL_DISK_ERROR) {
    LOG.warn("Fatal disk error on " + dnName + ": " + msg);
    namesystem.getBlockManager().getDatanodeManager().removeDatanode(nodeReg);            
  } else {
    LOG.info("Error report from " + dnName + ": " + msg);
  }
}
 
Example 4
Source File: DataNode.java    From big-c with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example 5
Source File: NameNode.java    From RDFS with Apache License 2.0 6 votes vote down vote up
/**
 */
public void errorReport(DatanodeRegistration nodeReg,
                        int errorCode,
                        String msg) throws IOException {
  // Log error message from datanode
  String dnName = (nodeReg == null ? "unknown DataNode" : nodeReg.getName());
  LOG.info("Error report from " + dnName + ": " + msg);
  if (errorCode == DatanodeProtocol.NOTIFY) {
    return;
  }
  verifyRequest(nodeReg);
  if (errorCode == DatanodeProtocol.DISK_ERROR) {
    LOG.warn("Volume failed on " + dnName); 
  } else if (errorCode == DatanodeProtocol.FATAL_DISK_ERROR) {
    namesystem.removeDatanode(nodeReg);            
  }
}
 
Example 6
Source File: DataNode.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private void handleDiskError(String errMsgr) throws IOException{
  boolean hasEnoughResource = data.hasEnoughResource();
  myMetrics.volumeFailures.inc();
  for(Integer namespaceId : namespaceManager.getAllNamespaces()){
    DatanodeProtocol nn = getNSNamenode(namespaceId);
    LOG.warn("DataNode.handleDiskError: Keep Running: " + hasEnoughResource);
    
    //if hasEnoughtResource = true - more volumes are available, so we don't want 
    // to shutdown DN completely and don't want NN to remove it.
    int dp_error = DatanodeProtocol.DISK_ERROR;
    if(hasEnoughResource == false) {
      // DN will be shutdown and NN should remove it
      dp_error = DatanodeProtocol.FATAL_DISK_ERROR;
    }
    //inform NameNode
    try {
      nn.errorReport(getDNRegistrationForNS(namespaceId), dp_error, errMsgr);
    } catch(IOException ignored) {              
    }
    
    
    if(hasEnoughResource) {
      for (NamespaceService nsos : namespaceManager.getAllNamenodeThreads()) {
        nsos.scheduleBlockReport(0);
      }
      return; // do not shutdown
    }
  }
  
  LOG.warn("DataNode is shutting down.\n" + errMsgr);
  shouldRun = false; 
}
 
Example 7
Source File: NameNode.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
/**
 */
public void errorReport(DatanodeRegistration nodeReg,
                        int errorCode, 
                        String msg) throws IOException {
  // Log error message from datanode
  String dnName = (nodeReg == null ? "unknown DataNode" : nodeReg.getName());
  LOG.info("Error report from " + dnName + ": " + msg);
  if (errorCode == DatanodeProtocol.NOTIFY) {
    return;
  }
  verifyRequest(nodeReg);
  if (errorCode == DatanodeProtocol.DISK_ERROR) {
    namesystem.removeDatanode(nodeReg);            
  }
}