@Override public void write(byte[] b, int off, int len) throws IOException { try { fos.write(b, off, len); } catch (IOException e) { // unexpected exception throw new FSError(e); // assume native fs error } }
LOG.fatal("FSError", e); try { tracker.fsError(t.getTaskID(), e.getMessage()); } catch (IOException ie) { LOG.fatal(t.getTaskID()+" reporting FSError", ie);
umbilical.fsError(taskid, e.getMessage()); e.printStackTrace(); } catch (SyncException e) { LOG.fatal("SyncError from child", e);
static IOException propagateFSError(FSError e) throws IOException { Throwables.propagateIfPossible(e.getCause(), IOException.class); return new IOException("Unexpected FSError", e); } }
LOG.fatal("FSError", e); try { tracker.fsError(t.getTaskID(), e.getMessage()); } catch (IOException ie) { LOG.fatal(t.getTaskID()+" reporting FSError", ie);
umbilical.fsError(taskid, e.getMessage()); e.printStackTrace(); } catch (SyncException e) { LOG.fatal("SyncError from child", e);
@Override public void write(int b) throws IOException { try { fos.write(b); } catch (IOException e) { // unexpected exception throw new FSError(e); // assume native fs error } } }
umbilical.fsError(classicAttemptID, e.getMessage());
@Override public int read() throws IOException { try { int value = fis.read(); if (value >= 0) { this.position++; statistics.incrementBytesRead(1); } return value; } catch (IOException e) { // unexpected exception throw new FSError(e); // assume native fs error } }
umbilical.fsError(taskid, e.getMessage()); } catch (Exception exception) { LOG.warn("Error running child", exception);
@Override public int read(long position, byte[] b, int off, int len) throws IOException { // parameter check validatePositionedReadArgs(position, b, off, len); if (len == 0) { return 0; } ByteBuffer bb = ByteBuffer.wrap(b, off, len); try { int value = fis.getChannel().read(bb, position); if (value > 0) { statistics.incrementBytesRead(value); } return value; } catch (IOException e) { throw new FSError(e); } }
umbilical.fsError(taskid, e.getMessage()); } catch (Throwable throwable) { LOG.warn("Error running child", throwable);
@Override public boolean truncate(Path f, final long newLength) throws IOException { FileStatus status = getFileStatus(f); if(status == null) { throw new FileNotFoundException("File " + f + " not found"); } if(status.isDirectory()) { throw new IOException("Cannot truncate a directory (=" + f + ")"); } long oldLength = status.getLen(); if(newLength > oldLength) { throw new IllegalArgumentException( "Cannot truncate to a larger file size. Current size: " + oldLength + ", truncate size: " + newLength + "."); } try (FileOutputStream out = new FileOutputStream(pathToFile(f), true)) { try { out.getChannel().truncate(newLength); } catch(IOException e) { throw new FSError(e); } } return true; }
umbilical.fsError(classicAttemptID, e.getMessage());
@Override public int read(byte[] b, int off, int len) throws IOException { // parameter check validatePositionedReadArgs(position, b, off, len); try { int value = fis.read(b, off, len); if (value > 0) { this.position += value; statistics.incrementBytesRead(value); } return value; } catch (IOException e) { // unexpected exception throw new FSError(e); // assume native fs error } }
umbilical.fsError(classicAttemptID, e.getMessage());
@Override public void write(byte[] b, int off, int len) throws IOException { try { fos.write(b, off, len); } catch (IOException e) { // unexpected exception throw new FSError(e); // assume native fs error } }
umbilical.fsError(taskid, e.getMessage()); } catch (Exception exception) { LOG.warn("Exception running child : "
@Override public void write(int b) throws IOException { try { fos.write(b); } catch (IOException e) { // unexpected exception throw new FSError(e); // assume native fs error } } }
LOG.fatal("FSError", e); try { tracker.internalFsError(t.getTaskID(), e.getMessage()); } catch (IOException ie) { LOG.fatal(t.getTaskID()+" reporting FSError", ie);