Search in sources :

Example 21 with ConnectionId

use of com.baidu.hugegraph.computer.core.network.ConnectionId in project hugegraph-computer by hugegraph.

the class AbstractNettyHandler method processFailMessage.

protected void processFailMessage(ChannelHandlerContext ctx, Channel channel, FailMessage failMessage) {
    int errorCode = failMessage.errorCode();
    TransportException exception = new TransportException(errorCode, "Remote error from '%s', cause: %s", TransportUtil.remoteAddress(channel), failMessage.message());
    ConnectionId connectionId = TransportUtil.remoteConnectionId(channel);
    this.transportHandler().exceptionCaught(exception, connectionId);
}
Also used : ConnectionId(com.baidu.hugegraph.computer.core.network.ConnectionId) TransportException(com.baidu.hugegraph.computer.core.common.exception.TransportException)

Example 22 with ConnectionId

use of com.baidu.hugegraph.computer.core.network.ConnectionId in project hugegraph-computer by hugegraph.

the class ChannelFutureListenerOnWrite method onFailure.

public void onFailure(Channel channel, Throwable cause) {
    TransportException exception;
    if (cause instanceof TransportException) {
        exception = (TransportException) cause;
    } else {
        exception = new TransportException("Failed to send data to '%s': %s", cause, TransportUtil.remoteAddress(channel), cause.getMessage());
    }
    ConnectionId connectionId = TransportUtil.remoteConnectionId(channel);
    this.handler.exceptionCaught(exception, connectionId);
}
Also used : ConnectionId(com.baidu.hugegraph.computer.core.network.ConnectionId) TransportException(com.baidu.hugegraph.computer.core.common.exception.TransportException)

Aggregations

ConnectionId (com.baidu.hugegraph.computer.core.network.ConnectionId)22 Test (org.junit.Test)10 TransportClient (com.baidu.hugegraph.computer.core.network.TransportClient)5 InetSocketAddress (java.net.InetSocketAddress)5 TransportConf (com.baidu.hugegraph.computer.core.network.TransportConf)4 FileManager (com.baidu.hugegraph.computer.core.store.FileManager)4 TransportException (com.baidu.hugegraph.computer.core.common.exception.TransportException)3 Managers (com.baidu.hugegraph.computer.core.manager.Managers)3 MessageRecvManager (com.baidu.hugegraph.computer.core.receiver.MessageRecvManager)3 SortManager (com.baidu.hugegraph.computer.core.sort.sorting.SortManager)3 Channel (io.netty.channel.Channel)3 SocketChannel (io.netty.channel.socket.SocketChannel)3 Before (org.junit.Before)3 MessageSendManager (com.baidu.hugegraph.computer.core.sender.MessageSendManager)2 RecvSortManager (com.baidu.hugegraph.computer.core.sort.sorting.RecvSortManager)2 SendSortManager (com.baidu.hugegraph.computer.core.sort.sorting.SendSortManager)2 FileGraphPartition (com.baidu.hugegraph.computer.core.compute.FileGraphPartition)1 MockMessageSender (com.baidu.hugegraph.computer.core.compute.MockMessageSender)1 NetworkBuffer (com.baidu.hugegraph.computer.core.network.buffer.NetworkBuffer)1 File (java.io.File)1