@Override public void seek(long pos) throws IOException { if (pos == mCurrentPosition) { return; } if (pos < 0) { throw new IOException("Seek position is negative: " + pos); } if (pos > mTachyonFile.length()) { throw new IOException("Seek position is past EOF: " + pos + ", fileSize = " + mTachyonFile.length()); } if (mTachyonFileInputStream != null) { mTachyonFileInputStream.seek(pos); } else { getHdfsInputStream(pos); // TODO(calvin): Optimize for the case when the data is still valid in the buffer // Invalidate buffer mBufferLimit = -1; } mCurrentPosition = pos; }