use of org.apache.ignite.igfs.mapreduce.records.IgfsNewLineRecordResolver in project ignite by apache.
the class IgfsNewLineDelimiterRecordResolverSelfTest method assertSplit.
/**
* Check split resolution.
*
* @param suggestedStart Suggested start.
* @param suggestedLen Suggested length.
* @param expStart Expected start.
* @param expLen Expected length.
* @param data File data.
* @throws Exception If failed.
*/
public void assertSplit(long suggestedStart, long suggestedLen, long expStart, long expLen, byte[] data) throws Exception {
write(data);
IgfsNewLineRecordResolver rslvr = resolver();
IgfsFileRange split;
try (IgfsInputStream is = read()) {
split = rslvr.resolveRecords(igfs, is, split(suggestedStart, suggestedLen));
}
assert split != null : "Split is null.";
assert split.start() == expStart : "Incorrect start [expected=" + expStart + ", actual=" + split.start() + ']';
assert split.length() == expLen : "Incorrect length [expected=" + expLen + ", actual=" + split.length() + ']';
}
use of org.apache.ignite.igfs.mapreduce.records.IgfsNewLineRecordResolver in project ignite by apache.
the class IgfsNewLineDelimiterRecordResolverSelfTest method assertSplitNull.
/**
* Check the split resolution resulted in {@code null}.
*
* @param suggestedStart Suggested start.
* @param suggestedLen Suggested length.
* @param data File data.
* @throws Exception If failed.
*/
public void assertSplitNull(long suggestedStart, long suggestedLen, byte[] data) throws Exception {
write(data);
IgfsNewLineRecordResolver rslvr = resolver();
IgfsFileRange split;
try (IgfsInputStream is = read()) {
split = rslvr.resolveRecords(igfs, is, split(suggestedStart, suggestedLen));
}
assert split == null : "Split is not null.";
}
Aggregations