public interface IgfsJob
IgfsTask. Before this job is executed, it is assigned one of the ranges provided by the
IgfsRecordResolverpassed to one of the
execute(org.apache.ignite.IgniteFileSystem, IgfsFileRange, org.apache.ignite.igfs.IgfsInputStream) method is given
job is expected to operate on, and already opened
IgfsInputStream for the file this range belongs to.
Note that provided input stream has position already adjusted to range start. However, it will not automatically stop on range end. This is done to provide capability in some cases to look beyond the range end or seek position before the reange start.
In majority of the cases, when you want to process only provided range, you should explicitly control amount
of returned data and stop at range end. You can also use
IgfsInputStreamJobAdapter, which operates
IgfsRangeInputStream bounded to range start and end, or manually wrap provided input stream with
You can inject any resources in concrete implementation, just as with regular
|Modifier and Type||Method and Description|
This method is called when system detects that completion of this job can no longer alter the overall outcome (for example, when parent task has already reduced the results).
Executes this job.
Object execute(IgniteFileSystem igfs, IgfsFileRange range, IgfsInputStream in) throws IgniteException, IOException
igfs- IGFS instance.
range- File range aligned to record boundaries.
in- Input stream for split file. This input stream is not aligned to range and points to file start by default.
IgniteException- If execution failed.
IOException- If file system operation resulted in IO exception.
Note that job cancellation is only a hint, and just like with
Thread.interrupt() method, it is really up to the actual job
instance to gracefully finish execution and exit.