org.apache.ignite.internal.processors.igfs

## Class IgfsBlockLocationImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.igfs.IgfsBlockLocationImpl

All Implemented Interfaces:
  Externalizable, Serializable, Binarylizable, IgfsBlockLocation

    public class IgfsBlockLocationImpl
    extends Object
    implements IgfsBlockLocation, Externalizable, Binarylizable

File block location in the grid.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`IgfsBlockLocationImpl()` Empty constructor for externalizable.
`IgfsBlockLocationImpl(IgfsBlockLocation location, long len)`
`IgfsBlockLocationImpl(long start, long len, Collection<ClusterNode> nodes)`
`IgfsBlockLocationImpl(long start, long len, Collection<String> names, Collection<String> hosts)`
`IgfsBlockLocationImpl(long start, long len, IgfsBlockLocation block)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`int` `hashCode()`
`Collection<String>` `hosts()` Compliant with Hadoop interface.
`void` `increaseLength(long addLen)`
`long` `length()` Length of the data block in the file.
`void` `length(long len)`
`Collection<String>` `names()` Compliant with Hadoop interface.
`Collection<UUID>` `nodeIds()` Nodes this block belongs to.
`void` `readBinary(BinaryReader reader)` Reads fields from provided reader.
`void` `readExternal(ObjectInput in)`
`long` `start()` Start position in the file this block relates to.
`String` `toString()`
`void` `writeBinary(BinaryWriter writer)` Writes fields to provided writer.
`void` `writeExternal(ObjectOutput out)`

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

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

### Constructor Detail

#### IgfsBlockLocationImpl

    public IgfsBlockLocationImpl()

Empty constructor for externalizable.

#### IgfsBlockLocationImpl

    public IgfsBlockLocationImpl(IgfsBlockLocation location,
                                 long len)

Parameters:
  `location` - HDFS block location.
  `len` - New length.

#### IgfsBlockLocationImpl

    public IgfsBlockLocationImpl(long start,
                                 long len,
                                 Collection<ClusterNode> nodes)

Parameters:
  `start` - Start.
  `len` - Length.
  `nodes` - Affinity nodes.

#### IgfsBlockLocationImpl

    public IgfsBlockLocationImpl(long start,
                                 long len,
                                 IgfsBlockLocation block)

Parameters:
  `start` - Start.
  `len` - Length.
  `block` - Block.

#### IgfsBlockLocationImpl

    public IgfsBlockLocationImpl(long start,
                                 long len,
                                 Collection<String> names,
                                 Collection<String> hosts)

Parameters:
  `start` - Start.
  `len` - Length.
  `names` - Collection of host:port addresses.
  `hosts` - Collection of host:port addresses.

### Method Detail

#### start

    public long start()

Description copied from interface: `IgfsBlockLocation`
Start position in the file this block relates to.

Specified by:
  `start` in interface `IgfsBlockLocation`
Returns:
  Start position.

#### length

    public long length()

Description copied from interface: `IgfsBlockLocation`
Length of the data block in the file.

Specified by:
  `length` in interface `IgfsBlockLocation`
Returns:
  Length.

#### increaseLength

    public void increaseLength(long addLen)

Parameters:
  `addLen` - Length to increase.

#### length

    public void length(long len)

Parameters:
  `len` - Block length.

#### nodeIds

    public Collection<UUID> nodeIds()

Description copied from interface: `IgfsBlockLocation`
Nodes this block belongs to. First node id in collection is primary node id.

Specified by:
  `nodeIds` in interface `IgfsBlockLocation`
Returns:
  Node IDs.

#### names

    public Collection<String> names()

Compliant with Hadoop interface.

Specified by:
  `names` in interface `IgfsBlockLocation`
Returns:
  Collection of host:port addresses.

#### hosts

    public Collection<String> hosts()

Compliant with Hadoop interface.

Specified by:
  `hosts` in interface `IgfsBlockLocation`
Returns:
  Collection of host names.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### 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

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

#### writeBinary

    public void writeBinary(BinaryWriter writer)
                     throws BinaryObjectException

Writes fields to provided writer.

Specified by:
  `writeBinary` in interface `Binarylizable`
Parameters:
  `writer` - Binary object writer.
Throws:
  `BinaryObjectException` - In case of error.

#### readBinary

    public void readBinary(BinaryReader reader)
                    throws BinaryObjectException

Reads fields from provided reader.

Specified by:
  `readBinary` in interface `Binarylizable`
Parameters:
  `reader` - Binary object reader.
Throws:
  `BinaryObjectException` - In case of error.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018