org.apache.ignite.igfs.mapreduce.records

## Class IgfsByteDelimiterRecordResolver

- java.lang.Object
- - org.apache.ignite.igfs.mapreduce.records.IgfsByteDelimiterRecordResolver

All Implemented Interfaces:
  Externalizable, Serializable, IgfsRecordResolver

Direct Known Subclasses:
  IgfsNewLineRecordResolver, IgfsStringDelimiterRecordResolver

    public class IgfsByteDelimiterRecordResolver
    extends Object
    implements IgfsRecordResolver, Externalizable

Record resolver which adjusts records based on provided delimiters. Both start position and length are shifted to the right, based on delimiter positions.

Note that you can use `IgfsStringDelimiterRecordResolver` if your delimiter is a plain string.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`IgfsByteDelimiterRecordResolver()` Empty constructor required for `Externalizable` support.
`IgfsByteDelimiterRecordResolver(byte[]... delims)` Creates delimiter-based record resolver.

### Method Summary

Methods
`void` `readExternal(ObjectInput in)`
`IgfsFileRange` `resolveRecords(IgniteFs fs, IgfsInputStream stream, IgfsFileRange suggestedRecord)` Adjusts record start offset and length.
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### IgfsByteDelimiterRecordResolver

    public IgfsByteDelimiterRecordResolver()

Empty constructor required for `Externalizable` support.

#### IgfsByteDelimiterRecordResolver

    public IgfsByteDelimiterRecordResolver(byte[]... delims)

Creates delimiter-based record resolver.

Parameters:
  `delims` - Delimiters.

### Method Detail

#### resolveRecords

    public IgfsFileRange resolveRecords(IgniteFs fs,
                               IgfsInputStream stream,
                               IgfsFileRange suggestedRecord)
                                 throws IgniteException,
                                        IOException

Adjusts record start offset and length.

Specified by:
  `resolveRecords` in interface `IgfsRecordResolver`
Parameters:
  `fs` - IGFS instance to use.
  `stream` - Input stream for split file.
  `suggestedRecord` - Suggested file system record.
Returns:
  New adjusted record. If this method returns `null`, original record is ignored.
Throws:
  `IgniteException` - If resolve failed.
  `IOException` - If resolve failed.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015