org.apache.ignite.internal.processors.cache

## Class GridCacheIoManager

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter
  - - org.apache.ignite.internal.processors.cache.GridCacheIoManager

All Implemented Interfaces:
  GridCacheSharedManager

    public class GridCacheIoManager
    extends GridCacheSharedManagerAdapter

Cache communication manager.

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`cctx, log`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheIoManager()`

### Method Summary

Methods
`void` `addHandler(int cacheId, Class<? extends GridCacheMessage> type, IgniteBiInClosure<UUID,? extends GridCacheMessage> c)` Adds message handler.
`void` `addOrderedHandler(Object topic, IgniteBiInClosure<UUID,? extends GridCacheMessage> c)` Adds ordered message handler.
`long` `nextIoId()`
`protected void` `onKernalStop0(boolean cancel)`
`void` `printMemoryStats()` Prints memory statistics (sizes of internal data structures, etc.).
`void` `removeHandler(int cacheId, Class<? extends GridCacheMessage> type)`
`void` `removeHandlers(int cacheId)`
`void` `removeOrderedHandler(Object topic)` Removed ordered message handler.
`void` `safeSend(Collection<? extends ClusterNode> nodes, GridCacheMessage msg, byte plc, IgnitePredicate<ClusterNode> fallback)` Sends message and automatically accounts for lefts nodes.
`void` `send(ClusterNode node, GridCacheMessage msg, byte plc)` Sends communication message.
`void` `send(UUID nodeId, GridCacheMessage msg, byte plc)` Sends communication message.
`void` `sendNoRetry(ClusterNode node, GridCacheMessage msg, byte plc)` Sends message without retries and node ping in case of error.
`void` `sendOrderedMessage(ClusterNode node, Object topic, GridCacheMessage msg, byte plc, long timeout)`
`void` `start0()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`context, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, start, startInfo, stop, stop0, stopInfo, toString`

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

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

### Constructor Detail

#### GridCacheIoManager

    public GridCacheIoManager()

### Method Detail

#### start0

    public void start0()
                throws IgniteCheckedException

Overrides:
  `start0` in class `GridCacheSharedManagerAdapter`
Throws:
  `IgniteCheckedException` - If failed.

#### onKernalStop0

    protected void onKernalStop0(boolean cancel)

Overrides:
  `onKernalStop0` in class `GridCacheSharedManagerAdapter`
Parameters:
  `cancel` - Cancel flag.

#### send

    public void send(ClusterNode node,
            GridCacheMessage msg,
            byte plc)
              throws IgniteCheckedException

Sends communication message.

Parameters:
  `node` - Node to send the message to.
  `msg` - Message to send.
  `plc` - IO policy.
Throws:
  `IgniteCheckedException` - If sending failed.
  `ClusterTopologyCheckedException` - If receiver left.

#### safeSend

    public void safeSend(Collection<? extends ClusterNode> nodes,
                GridCacheMessage msg,
                byte plc,
                @Nullable
                IgnitePredicate<ClusterNode> fallback)
                  throws IgniteCheckedException

Sends message and automatically accounts for lefts nodes.

Parameters:
  `nodes` - Nodes to send to.
  `msg` - Message to send.
  `plc` - IO policy.
  `fallback` - Callback for failed nodes.
Throws:
  `IgniteCheckedException` - If send failed.

#### send

    public void send(UUID nodeId,
            GridCacheMessage msg,
            byte plc)
              throws IgniteCheckedException

Sends communication message.

Parameters:
  `nodeId` - ID of node to send the message to.
  `msg` - Message to send.
  `plc` - IO policy.
Throws:
  `IgniteCheckedException` - If sending failed.

#### sendOrderedMessage

    public void sendOrderedMessage(ClusterNode node,
                          Object topic,
                          GridCacheMessage msg,
                          byte plc,
                          long timeout)
                            throws IgniteCheckedException

Parameters:
  `node` - Destination node.
  `topic` - Topic to send the message to.
  `msg` - Message to send.
  `plc` - IO policy.
  `timeout` - Timeout to keep a message on receiving queue.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### nextIoId

    public long nextIoId()

Returns:
  ID that auto-grows based on local counter and counters received from other nodes.

#### sendNoRetry

    public void sendNoRetry(ClusterNode node,
                   GridCacheMessage msg,
                   byte plc)
                     throws IgniteCheckedException

Sends message without retries and node ping in case of error.

Parameters:
  `node` - Node to send message to.
  `msg` - Message.
  `plc` - IO policy.
Throws:
  `IgniteCheckedException` - If send failed.

#### addHandler

    public void addHandler(int cacheId,
                  Class<? extends GridCacheMessage> type,
                  IgniteBiInClosure<UUID,? extends GridCacheMessage> c)

Adds message handler.

Parameters:
  `cacheId` - Cache ID.
  `type` - Type of message.
  `c` - Handler.

#### removeHandlers

    public void removeHandlers(int cacheId)

Parameters:
  `cacheId` - Cache ID to remove handlers for.

#### removeHandler

    public void removeHandler(int cacheId,
                     Class<? extends GridCacheMessage> type)

Parameters:
  `cacheId` - Cache ID to remove handlers for.
  `type` - Message type.

#### addOrderedHandler

    public void addOrderedHandler(Object topic,
                         IgniteBiInClosure<UUID,? extends GridCacheMessage> c)

Adds ordered message handler.

Parameters:
  `topic` - Topic.
  `c` - Handler.

#### removeOrderedHandler

    public void removeOrderedHandler(Object topic)

Removed ordered message handler.

Parameters:
  `topic` - Topic.

#### printMemoryStats

    public void printMemoryStats()

Prints memory statistics (sizes of internal data structures, etc.). NOTE: this method is for testing and profiling purposes only.

Specified by:
  `printMemoryStats` in interface `GridCacheSharedManager`
Overrides:
  `printMemoryStats` in class `GridCacheSharedManagerAdapter`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0.final
Release Date | : December 29 2015