/** * Returns a split for each store files directory using the block location * of each file as locality reference. */ @Override public List<InputSplit> getSplits(JobContext job) throws IOException { List<InputSplit> splits = new ArrayList<>(); List<FileStatus> files = listStatus(job); Text key = new Text(); for (FileStatus file: files) { Path path = file.getPath(); FileSystem fs = path.getFileSystem(job.getConfiguration()); LineReader reader = new LineReader(fs.open(path)); long pos = 0; int n; try { while ((n = reader.readLine(key)) > 0) { String[] hosts = getStoreDirHosts(fs, path); splits.add(new FileSplit(path, pos, n, hosts)); pos += n; } } finally { reader.close(); } } return splits; }
public synchronized void close() throws IOException { if (in != null) { in.close(); } } }
public static void close(LineReader reader) { if (reader == null) { return; } // try { reader.close(); } catch (Exception ignore) { } }
@Override public void close() throws IOException { if(in != null) { in.close(); } }
@Override public synchronized void close() throws IOException { if(in != null) { in.close(); } } }
@Override public synchronized void close() throws IOException { if(in != null) { in.close(); } } }
public synchronized void close() throws IOException { if (in != null) { in.close(); } } }
@Override public synchronized void close() throws IOException { if(in != null) { in.close(); } } }
@Override public void close() throws IOException { if (reader != null) { reader.close(); } }
@Override public void close() throws IOException { if (reader != null) { reader.close(); } }
@Override public synchronized void close() throws IOException { if(in != null) { in.close(); } } }
@Override public void close() throws IOException { LOG.debug("close()"); if (in != null) { in.close(); } }
@Override public void close() throws IOException { LOG.debug("close()"); if (in != null) { in.close(); } }
@Override public synchronized void close() throws IOException { super.close(); if (in_ != null) { in_.close(); } }
@Override public synchronized void close() throws IOException { super.close(); if (in_ != null) { in_.close(); } }
@Override public synchronized void close() throws IOException { super.close(); if (lineReader_ != null) { lineReader_.close(); } }
public synchronized void close() throws IOException { try { if (in != null) { in.close(); } } finally { if (decompressor != null) { CodecPool.returnDecompressor(decompressor); } } } }
@Override public synchronized void close() throws IOException { super.close(); if (in_ != null) { in_.close(); } }
@Override public void close() throws IOException { if (readerHelper != null) { if (readerHelper.getReader() != null) { readerHelper.getReader().close(); } if (readerHelper.getHolder() != null) { readerHelper.getHolder().close(); } readerHelper = null; } }