コード例 #1
0
 @Override
 public synchronized void seek(long pos) throws IOException {
   in.close();
   LOG.info("Opening key '" + key + "' for reading at position '" + pos + "'");
   in = store.retrieve(key, pos);
   this.pos = pos;
 }
コード例 #2
0
 @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 IOException("'" + 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));
 }