org.apache.ignite.internal.util.nio

## Class GridNioRecoveryDescriptor

- java.lang.Object
- - org.apache.ignite.internal.util.nio.GridNioRecoveryDescriptor

    public class GridNioRecoveryDescriptor
    extends Object

Recovery information for single node.

### Constructor Summary

Constructors
Constructor and Description
`GridNioRecoveryDescriptor(boolean pairedConnections, int queueLimit, ClusterNode node, IgniteLogger log)`

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `acked()`
`void` `ackReceived(long rcvCnt)`
`boolean` `add(SessionWriteRequest req)`
`boolean` `connected()`
`Long` `handshakeIndex()`
`long` `incrementConnectCount()`
`long` `lastAcknowledged()`
`void` `lastAcknowledged(long lastAck)`
`Deque<SessionWriteRequest>` `messagesRequests()`
`ClusterNode` `node()`
`boolean` `nodeAlive(@Nullable ClusterNode node)`
`void` `onConnected()`
`void` `onHandshake(long rcvCnt)`
`boolean` `onNodeLeft()` Node left callback.
`long` `onReceived()` Increments received messages counter.
`boolean` `pairedConnections()`
`int` `queueLimit()`
`long` `received()`
`void` `release()`
`boolean` `reserve()`
`int` `reserveCount()`
`boolean` `reserved()`
`long` `sent()`
`GridNioSession` `session()`
`void` `session(GridNioSession ses)`
`String` `toString()`
`boolean` `tryReserve(long id, IgniteInClosure<Boolean> c)`

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

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

### Constructor Detail

#### GridNioRecoveryDescriptor

    public GridNioRecoveryDescriptor(boolean pairedConnections,
                                     int queueLimit,
                                     ClusterNode node,
                                     IgniteLogger log)

Parameters:
  `pairedConnections` - `True` if in/out connections pair is used for communication with node.
  `queueLimit` - Maximum size of unacknowledged messages queue.
  `node` - Node.
  `log` - Logger.

### Method Detail

#### pairedConnections

    public boolean pairedConnections()

Returns:
  `True` if in/out connections pair is used for communication with node.

#### incrementConnectCount

    public long incrementConnectCount()

Returns:
  Connect count.

#### node

    public ClusterNode node()

Returns:
  Node.

#### onReceived

    public long onReceived()

Increments received messages counter.

Returns:
  Number of received messages.

#### received

    public long received()

Returns:
  Number of received messages.

#### sent

    public long sent()

Returns:
  Number of sent messages.

#### lastAcknowledged

    public void lastAcknowledged(long lastAck)

Parameters:
  `lastAck` - Last acknowledged message.

#### lastAcknowledged

    public long lastAcknowledged()

Returns:
  Last acknowledged message.

#### queueLimit

    public int queueLimit()

Returns:
  Maximum size of unacknowledged messages queue.

#### add

    public boolean add(SessionWriteRequest req)

Parameters:
  `req` - Write request.
Returns:
  `False` if queue limit is exceeded.

#### ackReceived

    public void ackReceived(long rcvCnt)

Parameters:
  `rcvCnt` - Number of messages received by remote node.

#### acked

    public long acked()

Returns:
  Last acked message by remote node.

#### onNodeLeft

    public boolean onNodeLeft()

Node left callback.

Returns:
  `False` if descriptor is reserved.

#### messagesRequests

    public Deque<SessionWriteRequest> messagesRequests()

Returns:
  Requests for unacknowledged messages.

#### nodeAlive

    public boolean nodeAlive(@Nullable
                             @Nullable ClusterNode node)

Parameters:
  `node` - Node.
Returns:
  `True` if node is not null and has the same order as initial remote node.

#### reserve

    public boolean reserve()
                    throws InterruptedException

Returns:
  `True` if reserved.
Throws:
  `InterruptedException` - If interrupted.

#### onHandshake

    public void onHandshake(long rcvCnt)

Parameters:
  `rcvCnt` - Number of messages received by remote node.

#### onConnected

    public void onConnected()

#### connected

    public boolean connected()

Returns:
  Connected flag.

#### reserved

    public boolean reserved()

Returns:
  Reserved flag.

#### handshakeIndex

    public Long handshakeIndex()

Returns:
  Current handshake index.

#### release

    public void release()

#### tryReserve

    public boolean tryReserve(long id,
                              IgniteInClosure<Boolean> c)

Parameters:
  `id` - Handshake ID.
  `c` - Closure to run on reserve.
Returns:
  `True` if reserved.

#### reserveCount

    public int reserveCount()

Returns:
  Number of descriptor reservations.

#### session

    public GridNioSession session()

Returns:
  Current session.

#### session

    public void session(GridNioSession ses)

Parameters:
  `ses` - Session.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.8.0
Release Date | : February 27 2020