use of org.apache.ignite.igfs.IgfsInputStream in project ignite by apache.
the class IgfsJobImpl method execute.
/** {@inheritDoc} */
@Override
public Object execute() {
IgniteFileSystem fs = ignite.fileSystem(igfsName);
try (IgfsInputStream in = fs.open(path)) {
IgfsFileRange split = new IgfsFileRange(path, start, len);
if (rslvr != null) {
split = rslvr.resolveRecords(fs, in, split);
if (split == null) {
log.warning("No data found for split on local node after resolver is applied " + "[igfsName=" + igfsName + ", path=" + path + ", start=" + start + ", len=" + len + ']');
return null;
}
}
in.seek(split.start());
return job.execute(fs, new IgfsFileRange(path, split.start(), split.length()), in);
} catch (IOException e) {
throw new IgniteException("Failed to execute IGFS job for file split [igfsName=" + igfsName + ", path=" + path + ", start=" + start + ", len=" + len + ']', e);
}
}
use of org.apache.ignite.igfs.IgfsInputStream in project ignite by apache.
the class IgfsCachePerBlockLruEvictionPolicySelfTest method read.
/**
* Read some data from the given file with the given offset.
*
* @param path File path.
* @param off Offset.
* @param len Length.
* @throws Exception If failed.
*/
private void read(IgfsPath path, int off, int len) throws Exception {
IgfsInputStream is = igfsPrimary.open(path);
is.readFully(off, new byte[len]);
is.close();
}
Aggregations