org.apache.ignite.internal.processors.igfs

## Class IgfsBlockLocationImpl

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

All Implemented Interfaces:
  Externalizable, Serializable, IgfsBlockLocation

    public class IgfsBlockLocationImpl
    extends Object
    implements IgfsBlockLocation, Externalizable

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)`

### Method Summary

Methods
`boolean` `equals(Object o)`
`int` `hashCode()`
`Collection<String>` `hosts()` Compliant with Hadoop interface.
`long` `length()` Length of the data block in the file.
`Collection<String>` `names()` Compliant with Hadoop interface.
`Collection<UUID>` `nodeIds()` Nodes this block belongs to.
`void` `readExternal(ObjectInput in)` Reads object from data input.
`long` `start()` Start position in the file this block relates to.
`String` `toString()`
`void` `writeExternal(ObjectOutput out)` Writes this object to data output.

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

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

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

Writes this object to data output. Note that this is not externalizable interface because we want to eliminate any marshaller.

Specified by:
  `writeExternal` in interface `Externalizable`
Parameters:
  `out` - Data output to write.
Throws:
  `IOException` - If write failed.

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException

Reads object from data input. Note we do not use externalizable interface to eliminate marshaller.

Specified by:
  `readExternal` in interface `Externalizable`
Parameters:
  `in` - Data input.
Throws:
  `IOException` - If read failed.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.4.0
Release Date | : September 24 2015