Class NettyClientFactory
- java.lang.Object
-
- org.apache.hugegraph.computer.core.network.netty.NettyClientFactory
-
- All Implemented Interfaces:
ClientFactory
public class NettyClientFactory extends java.lang.Object implements ClientFactory
-
-
Constructor Summary
Constructors Constructor Description NettyClientFactory(TransportConf conf)NettyClientFactory(TransportConf conf, io.netty.buffer.ByteBufAllocator bufAllocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close theClientFactoryTransportConfconf()TransportClientcreateClient(ConnectionId connectionId, ClientHandler handler)Create a newTransportClientto the remote address.protected io.netty.channel.ChanneldoConnect(java.net.InetSocketAddress address, int connectTimeoutMs)Connect to the remote server.protected io.netty.channel.ChanneldoConnectWithRetries(java.net.InetSocketAddress address, int retryNumber, int connectTimeoutMs)Connect to the remote server with retriesvoidinit()Initialize theClientFactoryprotected NettyProtocolprotocol()
-
-
-
Constructor Detail
-
NettyClientFactory
public NettyClientFactory(TransportConf conf)
-
NettyClientFactory
public NettyClientFactory(TransportConf conf, io.netty.buffer.ByteBufAllocator bufAllocator)
-
-
Method Detail
-
init
public void init()
Description copied from interface:ClientFactoryInitialize theClientFactory- Specified by:
initin interfaceClientFactory
-
createClient
public TransportClient createClient(ConnectionId connectionId, ClientHandler handler) throws TransportException
Create a newTransportClientto the remote address.- Specified by:
createClientin interfaceClientFactory- Parameters:
connectionId-ConnectionIdhandler-ClientHandler- Returns:
TransportClient- Throws:
TransportException
-
doConnect
protected io.netty.channel.Channel doConnect(java.net.InetSocketAddress address, int connectTimeoutMs) throws TransportExceptionConnect to the remote server.- Throws:
TransportException
-
doConnectWithRetries
protected io.netty.channel.Channel doConnectWithRetries(java.net.InetSocketAddress address, int retryNumber, int connectTimeoutMs) throws TransportExceptionConnect to the remote server with retries- Throws:
TransportException
-
conf
public TransportConf conf()
-
protocol
protected NettyProtocol protocol()
-
close
public void close()
Description copied from interface:ClientFactoryClose theClientFactory- Specified by:
closein interfaceClientFactory
-
-