Class GridNioServerWrapper
- java.lang.Object
-
- org.apache.ignite.spi.communication.tcp.internal.GridNioServerWrapper
-
public class GridNioServerWrapper extends Object
Deprecated.Should be removed.Container for nio server with required dependencies.
-
-
Constructor Summary
Constructors Constructor Description GridNioServerWrapper(IgniteLogger log, TcpCommunicationConfiguration cfg, AttributeNames attributeNames, Tracing tracing, Function<UUID,ClusterNode> nodeGetter, Supplier<ClusterNode> locNodeSupplier, ConnectGateway connectGate, ClusterStateProvider stateProvider, Supplier<IgniteExceptionRegistry> eRegistrySupplier, CommunicationWorker commWorker, IgniteConfiguration igniteCfg, GridNioServerListener<Message> srvLsnr, String igniteInstanceName, WorkersRegistry workersRegistry, @Nullable GridMetricManager metricMgr, ThrowableBiFunction<ClusterNode,Integer,GridCommunicationClient,IgniteCheckedException> createTcpClientFun, CommunicationListener<Message> lsnr, TcpHandshakeExecutor tcpHandshakeExecutor)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclear()Deprecated.Clears resources for gc.voidclientPool(ConnectionClientPool pool)Deprecated.voidcommunicationWorker(CommunicationWorker commWorker)Deprecated.GridNioSessioncreateNioSession(ClusterNode node, int connIdx)Deprecated.Returns the established TCP/IP connection between the current node and remote server.GridCommunicationClientcreateTcpClient(ClusterNode node, int connIdx, boolean backwardCompatibility)Deprecated.Establish TCP connection to remote node and returns client.ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor>inRecDescs()Deprecated.GridNioRecoveryDescriptorinRecoveryDescriptor(ClusterNode node, ConnectionKey key)Deprecated.GridNioServer<Message>nio()Deprecated.Returns original nio server instance.voidnio(GridNioServer<Message> srv)Deprecated.voidonChannelCreate(GridSelectorNioSessionImpl ses, ConnectionKey connKey, Message msg)Deprecated.IgniteInternalFuture<Channel>openChannel(ClusterNode remote, Message initMsg)Deprecated.ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor>outRecDescs()Deprecated.voidprocessSessionCreationError(ClusterNode node, Collection<InetSocketAddress> addrs, IgniteCheckedException errs)Deprecated.Process errors if TCP/IPGridNioSessioncreation to remote node hasn't been performed.ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor>recoveryDescs()Deprecated.GridNioServer<Message>resetNioServer()Deprecated.Recreates tpcSrvr socket instance.voidsocketChannelFactory(ThrowableSupplier<SocketChannel,IOException> sockChFactory)Deprecated.voidstart()Deprecated.Starts nio server.voidstop()Deprecated.Stops nio server.
-
-
-
Constructor Detail
-
GridNioServerWrapper
public GridNioServerWrapper(IgniteLogger log, TcpCommunicationConfiguration cfg, AttributeNames attributeNames, Tracing tracing, Function<UUID,ClusterNode> nodeGetter, Supplier<ClusterNode> locNodeSupplier, ConnectGateway connectGate, ClusterStateProvider stateProvider, Supplier<IgniteExceptionRegistry> eRegistrySupplier, CommunicationWorker commWorker, IgniteConfiguration igniteCfg, GridNioServerListener<Message> srvLsnr, String igniteInstanceName, WorkersRegistry workersRegistry, @Nullable @Nullable GridMetricManager metricMgr, ThrowableBiFunction<ClusterNode,Integer,GridCommunicationClient,IgniteCheckedException> createTcpClientFun, CommunicationListener<Message> lsnr, TcpHandshakeExecutor tcpHandshakeExecutor)
Deprecated.- Parameters:
log- Logger.cfg- Config.attributeNames- Attribute names.tracing- Tracing.nodeGetter- Node getter.locNodeSupplier- Local node supplier.connectGate- Connect gate.stateProvider- State provider.eRegistrySupplier- Exception registry supplier.commWorker- Communication worker.igniteCfg- Ignite config.srvLsnr- Server listener.igniteInstanceName- Ignite instance name.workersRegistry- Workers registry.tcpHandshakeExecutor- Executor for establishing a connection to a node.lsnr- Listener
-
-
Method Detail
-
start
public void start()
Deprecated.Starts nio server.
-
stop
public void stop()
Deprecated.Stops nio server.
-
clear
public void clear()
Deprecated.Clears resources for gc.
-
createNioSession
public GridNioSession createNioSession(ClusterNode node, int connIdx) throws IgniteCheckedException
Deprecated.Returns the established TCP/IP connection between the current node and remote server. A handshake process of negotiation between two communicating nodes will be performed before theGridNioSessioncreated.The handshaking process contains of these steps:
- The local node opens a new
SocketChannelin the blocking mode. - The local node calls
SocketChannel.connect(SocketAddress)to remote node. - The remote GridNioAcceptWorker thread accepts new connection.
- The remote node sends back the
NodeIdMessage. - The local node reads NodeIdMessage from created channel.
- The local node sends the
HandshakeMessage2to remote. - The remote node processes
HandshakeMessage2inGridNioServerListener.onMessage(GridNioSession, Object). - The remote node sends back the
RecoveryLastReceivedMessage.
Note. The
HandshakeTimeoutObjectis created to control execution timeout during the whole handshaking process.- Parameters:
node- Remote node identifier to connect with.connIdx- Connection index based on configuredConnectionPolicy.- Returns:
- A
GridNioSessionconnection representation. - Throws:
IgniteCheckedException- If establish connection fails.
- The local node opens a new
-
createTcpClient
public GridCommunicationClient createTcpClient(ClusterNode node, int connIdx, boolean backwardCompatibility) throws IgniteCheckedException
Deprecated.Establish TCP connection to remote node and returns client.- Parameters:
node- Remote node.connIdx- Connection index.backwardCompatibility- It calls the method from protected class.- Returns:
- Client.
- Throws:
IgniteCheckedException- If failed.
-
nio
public GridNioServer<Message> nio()
Deprecated.Returns original nio server instance.
-
nio
public void nio(GridNioServer<Message> srv)
Deprecated.- Parameters:
srv- Server.
-
inRecoveryDescriptor
public GridNioRecoveryDescriptor inRecoveryDescriptor(ClusterNode node, ConnectionKey key)
Deprecated.- Parameters:
node- Node.key- Connection key.- Returns:
- Recovery descriptor for incoming connection.
-
recoveryDescs
public ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor> recoveryDescs()
Deprecated.- Returns:
- Recovery descs.
-
outRecDescs
public ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor> outRecDescs()
Deprecated.- Returns:
- Out rec descs.
-
inRecDescs
public ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor> inRecDescs()
Deprecated.- Returns:
- In rec descs.
-
processSessionCreationError
public void processSessionCreationError(ClusterNode node, Collection<InetSocketAddress> addrs, IgniteCheckedException errs) throws IgniteCheckedException
Deprecated.Process errors if TCP/IPGridNioSessioncreation to remote node hasn't been performed.- Parameters:
node- Remote node.addrs- Remote node addresses.errs- TCP client creation errors.- Throws:
IgniteCheckedException- If failed.
-
resetNioServer
public GridNioServer<Message> resetNioServer() throws IgniteCheckedException
Deprecated.Recreates tpcSrvr socket instance.- Returns:
- Server instance.
- Throws:
IgniteCheckedException- Thrown if it's not possible to create server.
-
onChannelCreate
public void onChannelCreate(GridSelectorNioSessionImpl ses, ConnectionKey connKey, Message msg)
Deprecated.
-
openChannel
public IgniteInternalFuture<Channel> openChannel(ClusterNode remote, Message initMsg) throws IgniteSpiException
Deprecated.- Parameters:
remote- Destination cluster node to communicate with.initMsg- Configuration channel attributes wrapped into the message.- Returns:
- The future, which will be finished on channel ready.
- Throws:
IgniteSpiException- If fails.
-
communicationWorker
public void communicationWorker(CommunicationWorker commWorker)
Deprecated.- Parameters:
commWorker- New recovery and idle clients handler.
-
clientPool
public void clientPool(ConnectionClientPool pool)
Deprecated.- Parameters:
pool- Client pool.
-
socketChannelFactory
public void socketChannelFactory(ThrowableSupplier<SocketChannel,IOException> sockChFactory)
Deprecated.- Parameters:
sockChFactory- New socket channel factory.
-
-