Examples of GraphLabNodeInfo


Examples of org.graphlab.net.GraphLabNodeInfo

        public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
            GraphLabMessage message = (GraphLabMessage) e.getMessage();
            switch(message.getMessageId()) {
                case MessageIds.NODEINFO:
                    NodeInfoMessage nodeInfoMessage = (NodeInfoMessage) message;
                    GraphLabNodeInfo nodeInfo = nodeInfoMessage.getNodeInfo();
                    otherNodes.put(nodeInfo.getId(), nodeInfo);
                    System.out.println("Other nodes: " +  nodeInfo);
                    connectToSlave(nodeInfo);
                    break;
                case MessageIds.EXECUTEPHASE:
                    ExecutePhaseMessage execPhaseMsg = (ExecutePhaseMessage) message;
View Full Code Here

Examples of org.graphlab.net.GraphLabNodeInfo

        @Override
        public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
            int channelId = e.getChannel().getId();
            if (channelIdToNodeId.containsKey(channelId)) {
                int nodeId = channelIdToNodeId.get(channelId);
                GraphLabNodeInfo nodeInfo = nodes.get(nodeId);
                nodes.remove(nodeId);
                nodesToChannels.remove(nodeId);
                channelIdToNodeId.remove(channelId);
                master.remoteUnregisterSlave(nodeInfo);
            }
View Full Code Here

Examples of org.graphlab.net.GraphLabNodeInfo

                            }
                            if (keyToRemove != null) channelIdToNodeId.remove(keyToRemove);
                        }

                        // Register
                        GraphLabNodeInfo nodeInfo =  new GraphLabNodeInfo(handshake.getNodeId(),
                                InetAddress.getByName(handshake.getAddress()),
                                handshake.getPort());
                        synchronized (this) {
                            nodes.put(handshake.getNodeId(),
                                    nodeInfo);
                            channelIdToNodeId.put(e.getChannel().getId(), handshake.getNodeId());
                            nodesToChannels.put(handshake.getNodeId(), ctx.getChannel());

                            // Send all other nodes this node
                            for(Integer nodeId: nodesToChannels.keySet()) {
                                System.out.println("*" + nodeId + "; " + handshake.getNodeId());
                                if (nodeId != handshake.getNodeId()) {
                                    sendClient(nodeId, new NodeInfoMessage(nodeInfo));
                                    // Send other clients to this node
                                    sendClient(nodeInfo.getId(), new NodeInfoMessage(nodes.get(nodeId)));
                                }
                            }
                        }
                        master.remoteRegisterSlave(nodeInfo);
                        System.out.println("Nodes now: " + nodes);
View Full Code Here

Examples of org.graphlab.net.GraphLabNodeInfo

                int nodeId = buf.readInt();
                String address = GraphLabMessage.readString(buf);
                if (address == null) return null;
                int port = buf.readInt();
                try {
                    return new NodeInfoMessage(new GraphLabNodeInfo(nodeId, InetAddress.getByName(address), port));
                } catch (Exception err) {
                    throw new RuntimeException(err);
                }
            }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.