/** * Closes the file input stream of the input format. */ @Override public void close() throws IOException { if (this.stream != null) { // close input stream this.stream.close(); stream = null; } }
@Override public void run() { try { final FileSystem fs = FileSystem.get(this.split.getPath().toUri()); this.fdis = fs.open(this.split.getPath()); // check for canceling and close the stream in that case, because no one will obtain it if (this.aborted) { final FSDataInputStream f = this.fdis; this.fdis = null; f.close(); } } catch (Throwable t) { this.error = t; } }
/** * Resolve a child path against a parent path. * * @param parent * the parent path * @param child * the child path */ public Path(Path parent, String child) { this(parent, new Path(child)); }
private FSDataInputStream getInputStream() throws IOException { if (this.inputStream == null) { this.inputStream = this.fs.open(this.checkpointFile, this.buf.length); } return this.inputStream; }
@Override public void close() throws IOException { final FSDataOutputStream s = this.stream; if (s != null) { this.stream = null; s.close(); } }
/** * Resolve a child path against a parent path. * * @param parent * the parent path * @param child * the child path */ public Path(String parent, Path child) { this(new Path(parent), child); }
public void close() throws IOException { this.wrapBuffer = null; this.readBuffer = null; if (this.stream != null) { this.stream.close(); } }
private FSDataInputStream getInputStream() throws IOException { if (this.inputStream == null) { this.inputStream = this.fs.open(this.checkpointFile, this.buf.length); } return this.inputStream; }
/** * Resolve a child path against a parent path. * * @param parent * the parent path * @param child * the child path */ public Path(Path parent, String child) { this(parent, new Path(child)); }
/** * A simple hook to filter files and directories from the input. * The method may be overridden. Hadoop's FileInputFormat has a similar mechanism and applies the * same filters by default. * * @param fileStatus * @return true, if the given file or directory is accepted */ protected boolean acceptFile(FileStatus fileStatus) { final String name = fileStatus.getPath().getName(); return !name.startsWith("_") && !name.startsWith("."); }
/** * Closes the file input stream of the input format. */ @Override public void close() throws IOException { if (this.stream != null) { // close input stream this.stream.close(); stream = null; } }
/** * Resolve a child path against a parent path. * * @param parent * the parent path * @param child * the child path */ public Path(String parent, Path child) { this(new Path(parent), child); }
/** * A simple hook to filter files and directories from the input. * The method may be overridden. Hadoop's FileInputFormat has a similar mechanism and applies the * same filters by default. * * @param fileStatus * @return true, if the given file or directory is accepted */ protected boolean acceptFile(FileStatus fileStatus) { final String name = fileStatus.getPath().getName(); return !name.startsWith("_") && !name.startsWith("."); }