protected void checkDiskError( IOException e ) throws IOException { if (e.getMessage() != null && e.getMessage().startsWith("No space left on device")) { throw new DiskOutOfSpaceException("No space left on device"); } else { checkDiskError(); } }
datanode.checkDiskError(ioe); throw ioe;
/** Check if there is no space in disk * @param e that caused this checkDiskError call **/ protected void checkDiskError(Exception e ) throws IOException { if (e instanceof ClosedByInterruptException || e instanceof java.io.InterruptedIOException) { return; } LOG.warn("checkDiskError: exception: ", e); if (e.getMessage() != null && e.getMessage().startsWith("No space left on device")) { throw new DiskOutOfSpaceException("No space left on device"); } else { checkDiskError(); } }
/** Check if there is no space in disk * @param e that caused this checkDiskError call **/ protected void checkDiskError(Exception e ) throws IOException { LOG.warn("checkDiskError: exception: ", e); if (e instanceof SocketException || e instanceof SocketTimeoutException || e instanceof ClosedByInterruptException || e.getMessage().startsWith("An established connection was aborted") || e.getMessage().startsWith("Broken pipe") || e.getMessage().startsWith("Connection reset") || e.getMessage().contains("java.nio.channels.SocketChannel")) { LOG.info("Not checking disk as checkDiskError was called on a network" + " related exception"); return; } if (e.getMessage() != null && e.getMessage().startsWith("No space left on device")) { throw new DiskOutOfSpaceException("No space left on device"); } else { checkDiskError(); } }
datanode.checkDiskError(ioe);
/** * Find the file corresponding to the block and return it if it exists. */ File getValidateBlockFile(int namespaceId, Block b, boolean checkSize) throws IOException { //Should we check for metadata file too? DatanodeBlockInfo blockInfo = getDatanodeBlockInfo(namespaceId, b); File f = null; if (blockInfo != null) { if (checkSize) { blockInfo.verifyFinalizedSize(); } f = blockInfo.getFile(); if(f.exists()) return f; // if file is not null, but doesn't exist - possibly disk failed datanode.checkDiskError(); } if (InterDatanodeProtocol.LOG.isDebugEnabled()) { InterDatanodeProtocol.LOG.debug("b=" + b + ", f=" + ((f == null) ? "null" : f)); } return null; }
datanode.checkDiskError(iex); throw iex;
throw iix; } catch (IOException iex) { datanode.checkDiskError(iex); throw iex;
checkDiskError(ie); } catch(IOException e) { LOG.warn("DataNode.checkDiskError failed in run() with: ", e);
datanode.checkDiskError(ioe); // may throw an exception here
if (cause != null) { // possible disk error ioe = cause; datanode.checkDiskError(ioe); // may throw an exception here
datanode.checkDiskError(); } catch (IOException e) { LOG.warn("Error when checking disks : " + StringUtils.stringifyException(e));