public interface GridGgfsRecordResolver extends Serializable
GridGgfsTask is split into GridGgfsJobs each produced job will obtain
GridGgfsFileRange based on file data location. Record resolver is invoked in each job before actual
execution in order to adjust record boundaries in a way consistent with user data.
E.g., you may want to split your task into jobs so that each job process zero, one or several lines from that file. But file is split into ranges based on block locations, not new line boundaries. Using convenient record resolver you can adjust job range so that it covers the whole line(s).
The following record resolvers are available out of the box:
| Modifier and Type | Method and Description |
|---|---|
GridGgfsFileRange |
resolveRecords(GridGgfs ggfs,
GridGgfsInputStream stream,
GridGgfsFileRange suggestedRecord)
Adjusts record start offset and length.
|
@Nullable GridGgfsFileRange resolveRecords(GridGgfs ggfs, GridGgfsInputStream stream, GridGgfsFileRange suggestedRecord) throws GridException, IOException
ggfs - GGFS instance to use.stream - Input stream for split file.suggestedRecord - Suggested file system record.null, original record is ignored.GridException - If resolve failed.IOException - If resolve failed.Copyright © 2014. All rights reserved.