public synchronized void seek(long pos) throws IOException { in.close(); in = store.retrieve(key, pos); this.pos = pos; } public synchronized long getPos() throws IOException {
public synchronized void seek(long pos) throws IOException { in.close(); in = store.retrieve(key, pos); this.pos = pos; } public synchronized long getPos() throws IOException {
/** * Reopen a new input stream with the specified position * @param pos the position to reopen a new stream * @throws IOException */ private synchronized void reopen(long pos) throws IOException { LOG.debug("Reopening key '{}' for reading at position '{}", key, pos); InputStream newStream = store.retrieve(key, pos); updateInnerStream(newStream, pos); }
@Override public FSDataInputStream open(Path f, int bufferSize) throws IOException { FileStatus fs = getFileStatus(f); // will throw if the file doesn't exist if (fs.isDirectory()) { throw new FileNotFoundException("'" + f + "' is a directory"); } LOG.info("Opening '" + f + "' for reading"); Path absolutePath = makeAbsolute(f); String key = pathToKey(absolutePath); return new FSDataInputStream(new BufferedFSInputStream( new NativeS3FsInputStream(store, statistics, store.retrieve(key), key), bufferSize)); }
@Override public FSDataInputStream open(Path f, int bufferSize) throws IOException { if (!exists(f)) { throw new FileNotFoundException(f.toString()); } Path absolutePath = makeAbsolute(f); String key = pathToKey(absolutePath); return new FSDataInputStream(new BufferedFSInputStream( new NativeS3FsInputStream(store.retrieve(key), key), bufferSize)); }
@Override public FSDataInputStream open(Path f, int bufferSize) throws IOException { if (!exists(f)) { throw new FileNotFoundException(f.toString()); } Path absolutePath = makeAbsolute(f); String key = pathToKey(absolutePath); return new FSDataInputStream(new BufferedFSInputStream( new NativeS3FsInputStream(store.retrieve(key), key), bufferSize)); }