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, diagnosticLog, log`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheIoManager()`

### Method Summary

All Methods Instance Methods Concrete Methods
`<Msg extends GridCacheGroupIdMessage> void` `addCacheGroupHandler(int hndId, Class<Msg> type, IgniteBiInClosure<UUID,? super Msg> c)`
`<Msg extends GridCacheMessage> void` `addCacheHandler(int hndId, Class<Msg> type, IgniteBiInClosure<UUID,? super Msg> c)`
`void` `addOrderedCacheGroupHandler(GridCacheSharedContext cctx, Object topic, IgniteBiInClosure<UUID,? extends GridCacheGroupIdMessage> c)`
`void` `addOrderedCacheHandler(GridCacheSharedContext cctx, Object topic, IgniteBiInClosure<UUID,? extends GridCacheIdMessage> c)`
`boolean` `checkNodeLeft(UUID nodeId, IgniteCheckedException sndErr, boolean ping)`
`void` `dumpPendingMessages(StringBuilder sb)`
`long` `nextIoId()`
`protected void` `onKernalStop0(boolean cancel)`
`void` `onMessageProcessed(GridCacheMessage msg)`
`void` `printMemoryStats()` Prints memory statistics (sizes of internal data structures, etc.).
`@Nullable Lock` `readLock()`
`void` `removeHandler(boolean cacheGrp, int hndId, Class<? extends GridCacheMessage> type)`
`void` `removeOrderedHandler(boolean cacheGrp, Object topic)` Removed ordered message handler.
`void` `send(ClusterNode node, GridCacheMessage msg, byte plc)` Sends communication message.
`void` `send(UUID nodeId, GridCacheMessage msg, byte plc)` Sends communication message.
`void` `sendOrderedMessage(ClusterNode node, Object topic, GridCacheMessage msg, byte plc, long timeout)`
`void` `start0()`
`void` `writeLock()`
`void` `writeUnlock()`

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

`context, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, onReconnected, 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

#### dumpPendingMessages

    public void dumpPendingMessages(StringBuilder sb)

Parameters:
  `sb` - String builder.

#### start0

    public void start0()
                throws IgniteCheckedException

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

#### readLock

    @Nullable
    public @Nullable Lock readLock()

Returns:
  Lock or `null` if node is stopping.

#### writeLock

    public void writeLock()

#### writeUnlock

    public void writeUnlock()

#### onKernalStop0

    protected void onKernalStop0(boolean cancel)

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

#### onMessageProcessed

    public void onMessageProcessed(GridCacheMessage msg)

Parameters:
  `msg` - Message.

#### checkNodeLeft

    public boolean checkNodeLeft(UUID nodeId,
                                 IgniteCheckedException sndErr,
                                 boolean ping)
                          throws IgniteClientDisconnectedCheckedException

Parameters:
  `nodeId` - Node ID.
  `sndErr` - Send error.
  `ping` - `True` if try ping node.
Returns:
  `True` if node left.
Throws:
  `IgniteClientDisconnectedCheckedException` - If ping failed.

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

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

#### addCacheHandler

    public <Msg extends GridCacheMessage> void addCacheHandler(int hndId,
                                                               Class<Msg> type,
                                                               IgniteBiInClosure<UUID,? super Msg> c)

Parameters:
  `hndId` - Message handler ID.
  `type` - Type of message.
  `c` - Handler.

#### addCacheGroupHandler

    public <Msg extends GridCacheGroupIdMessage> void addCacheGroupHandler(int hndId,
                                                                           Class<Msg> type,
                                                                           IgniteBiInClosure<UUID,? super Msg> c)

Parameters:
  `hndId` - Message handler ID.
  `type` - Type of message.
  `c` - Handler.

#### removeHandler

    public void removeHandler(boolean cacheGrp,
                              int hndId,
                              Class<? extends GridCacheMessage> type)

Parameters:
  `cacheGrp` - `True` if cache group handler, `false` if cache handler.
  `hndId` - Handler ID.
  `type` - Message type.

#### addOrderedCacheHandler

    public void addOrderedCacheHandler(GridCacheSharedContext cctx,
                                       Object topic,
                                       IgniteBiInClosure<UUID,? extends GridCacheIdMessage> c)

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

#### addOrderedCacheGroupHandler

    public void addOrderedCacheGroupHandler(GridCacheSharedContext cctx,
                                            Object topic,
                                            IgniteBiInClosure<UUID,? extends GridCacheGroupIdMessage> c)

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

#### removeOrderedHandler

    public void removeOrderedHandler(boolean cacheGrp,
                                     Object topic)

Removed ordered message handler.

Parameters:
  `cacheGrp` - `True` if cache group message, `false` if cache message.
  `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`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022