List of usage examples for org.apache.hadoop.fs FileContext open
public FSDataInputStream open(final Path f, final int bufferSize) throws AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException
From source file:org.elasticsearch.repositories.hdfs.HdfsBlobContainer.java
License:Apache License
@Override public InputStream readBlob(String blobName) throws IOException { if (!blobExists(blobName)) { throw new NoSuchFileException("Blob [" + blobName + "] does not exist"); }//from w w w . ja va 2 s . c om // FSDataInputStream does buffering internally return store.execute(new Operation<InputStream>() { @Override public InputStream run(FileContext fileContext) throws IOException { return fileContext.open(new Path(path, blobName), bufferSize); } }); }