@Override public void close() throws IOException { final FSDataOutputStream s = this.stream; if (s != null) { this.stream = null; s.close(); } }
@Override public void close() throws IOException { final FSDataOutputStream s = this.stream; if (s != null) { this.stream = null; s.close(); } }
/** * Double checked procedure setting the abort flag and closing the stream. */ private final void abortWait() { this.aborted = true; final FSDataOutputStream outStream = this.fdos; this.fdos = null; if (outStream != null) { try { outStream.close(); } catch (Throwable t) {} } } }
/** * Double checked procedure setting the abort flag and closing the stream. */ private final void abortWait() { this.aborted = true; final FSDataOutputStream outStream = this.fdos; this.fdos = null; if (outStream != null) { try { outStream.close(); } catch (Throwable t) {} } } }
@Override protected void implCloseChannel() throws IOException { if (this.outputStream != null) { this.outputStream.close(); this.outputStream = null; } if (this.inputStream != null) { this.inputStream.close(); this.inputStream = null; } } }
@Override protected void implCloseChannel() throws IOException { if (this.outputStream != null) { this.outputStream.close(); this.outputStream = null; } if (this.inputStream != null) { this.inputStream.close(); this.inputStream = null; } } }
/** * Reads library data from the given stream. * * @param in * the stream to read the library data from * @throws IOException * throws if an error occurs while reading from the stream */ private void readLibraryFromStreamInternal(final DataInput in) throws IOException { final String libraryFileName = StringRecord.readString(in); if (libraryFileName == null) { throw new IOException("libraryFileName is null!"); } final long length = in.readLong(); if (length > (long) Integer.MAX_VALUE) { throw new IOException("Submitted jar file " + libraryFileName + " is too large"); } final byte[] buf = new byte[(int) length]; in.readFully(buf); final Path storePath = new Path(this.libraryCachePath + "/" + libraryFileName); synchronized (this.fs) { // Check if file already exists in our library cache, if not write it to the cache directory if (!fs.exists(storePath)) { final FSDataOutputStream fos = fs.create(storePath, false); fos.write(buf, 0, buf.length); fos.close(); } } }
/** * Reads library data from the given stream. * * @param in * the stream to read the library data from * @throws IOException * throws if an error occurs while reading from the stream */ private void readLibraryFromStreamInternal(final DataInput in) throws IOException { final String libraryFileName = StringRecord.readString(in); if (libraryFileName == null) { throw new IOException("libraryFileName is null!"); } final long length = in.readLong(); if (length > (long) Integer.MAX_VALUE) { throw new IOException("Submitted jar file " + libraryFileName + " is too large"); } final byte[] buf = new byte[(int) length]; in.readFully(buf); final Path storePath = new Path(this.libraryCachePath + "/" + libraryFileName); synchronized (this.fs) { // Check if file already exists in our library cache, if not write it to the cache directory if (!fs.exists(storePath)) { final FSDataOutputStream fos = fs.create(storePath, false); fos.write(buf, 0, buf.length); fos.close(); } } }
final FSDataOutputStream fos = this.fs.create(storePath, false); fos.write(buf, 0, buf.length); fos.close();
final FSDataOutputStream fos = this.fs.create(storePath, false); fos.write(buf, 0, buf.length); fos.close();
final FSDataOutputStream f = this.fdos; this.fdos = null; f.close();
final FSDataOutputStream f = this.fdos; this.fdos = null; f.close();
lfsoutput1.close();