org.apache.ignite.internal.processors.hadoop.shuffle

## Class HadoopShuffleMessage

- java.lang.Object
- - org.apache.ignite.internal.processors.hadoop.shuffle.HadoopShuffleMessage

All Implemented Interfaces:
  Externalizable, Serializable, HadoopMessage, Message

    public class HadoopShuffleMessage
    extends Object
    implements Message, HadoopMessage

Shuffle message.

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static interface` `HadoopShuffleMessage.Visitor` Visitor.

### Constructor Summary

Constructors
Constructor and Description
`HadoopShuffleMessage()`
`HadoopShuffleMessage(HadoopJobId jobId, int reducer, int size)`

### Method Summary

Methods
`void` `addKey(long keyPtr, int keySize)`
`void` `addValue(long valPtr, int valSize)`
`boolean` `available(int size, boolean valOnly)`
`byte[]` `buffer()`
`byte` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`long` `id()`
`HadoopJobId` `jobId()`
`int` `offset()`
`void` `onAckReceived()` Method called when ack message received.
`void` `readExternal(ObjectInput in)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`int` `reducer()`
`String` `toString()`
`void` `visit(HadoopShuffleMessage.Visitor v)`
`void` `writeExternal(ObjectOutput out)`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

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

### Constructor Detail

#### HadoopShuffleMessage

    public HadoopShuffleMessage()

#### HadoopShuffleMessage

    public HadoopShuffleMessage(HadoopJobId jobId,
                        int reducer,
                        int size)

Parameters:
  `size` - Size.

### Method Detail

#### id

    public long id()

Returns:
  Message ID.

#### jobId

    public HadoopJobId jobId()

Returns:
  Job ID.

#### reducer

    public int reducer()

Returns:
  Reducer.

#### buffer

    public byte[] buffer()

Returns:
  Buffer.

#### offset

    public int offset()

Returns:
  Offset.

#### available

    public boolean available(int size,
                    boolean valOnly)

Parameters:
  `size` - Size.
  `valOnly` - Only value wll be added.
Returns:
  `true` If this message can fit additional data of this size

#### addKey

    public void addKey(long keyPtr,
              int keySize)

Parameters:
  `keyPtr` - Key pointer.
  `keySize` - Key size.

#### addValue

    public void addValue(long valPtr,
                int valSize)

Parameters:
  `valPtr` - Value pointer.
  `valSize` - Value size.

#### visit

    public void visit(HadoopShuffleMessage.Visitor v)
               throws IgniteCheckedException

Parameters:
  `v` - Visitor.
Throws:
  `IgniteCheckedException`

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                  MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                   MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### directType

    public byte directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

Specified by:
  `fieldsCount` in interface `Message`
Returns:
  Fields count.

#### onAckReceived

    public void onAckReceived()

Method called when ack message received.

Specified by:
  `onAckReceived` in interface `Message`

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

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.9.0
Release Date | : March 2 2017