org.apache.ignite.igfs.mapreduce.records

## Class IgfsFixedLengthRecordResolver

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

All Implemented Interfaces:
  Externalizable, Serializable, IgfsRecordResolver

    public class IgfsFixedLengthRecordResolver
    extends Object
    implements IgfsRecordResolver, Externalizable

Record resolver which adjusts records to fixed length. That is, start offset of the record is shifted to the nearest position so that `newStart % length == 0`.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`IgfsFixedLengthRecordResolver()` Empty constructor required for `Externalizable` support.
`IgfsFixedLengthRecordResolver(long recLen)` Creates fixed-length record resolver.

### Method Summary

Methods
`void` `readExternal(ObjectInput in)`
`IgfsFileRange` `resolveRecords(IgniteFileSystem 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

#### IgfsFixedLengthRecordResolver

    public IgfsFixedLengthRecordResolver()

Empty constructor required for `Externalizable` support.

#### IgfsFixedLengthRecordResolver

    public IgfsFixedLengthRecordResolver(long recLen)

Creates fixed-length record resolver.

Parameters:
  `recLen` - Record length.

### Method Detail

#### resolveRecords

    public IgfsFileRange resolveRecords(IgniteFileSystem 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-RC3
Release Date | : March 24 2015