@Override public void run() { try { InetSocketAddress addr = CrailUtils.getNameNodeAddress(); namenodeServerEp.bind(addr, DaRPCConstants.NAMENODE_DARPC_BACKLOG); LOG.info("opened server at " + addr); while (true) { DaRPCServerEndpoint<DaRPCNameNodeRequest, DaRPCNameNodeResponse> clientEndpoint = namenodeServerEp.accept(); LOG.info("accepting RPC connection, qpnum " + clientEndpoint.getQp().getQp_num()); } } catch(Exception e){ e.printStackTrace(); LOG.error(e.getMessage()); } }
public void init(CrailConfiguration conf, String[] args) throws Exception { RdmaConstants.init(conf, args); this.serverAddr = StorageUtils.getDataNodeAddress(RdmaConstants.STORAGE_RDMA_INTERFACE, RdmaConstants.STORAGE_RDMA_PORT); if (serverAddr == null){ LOG.info("Configured network interface " + RdmaConstants.STORAGE_RDMA_INTERFACE + " cannot be found..exiting!!!"); return; } this.datanodeGroup = new RdmaPassiveEndpointGroup<RdmaStorageServerEndpoint>(-1, RdmaConstants.STORAGE_RDMA_QUEUESIZE, 4, RdmaConstants.STORAGE_RDMA_QUEUESIZE*100); this.datanodeServerEndpoint = datanodeGroup.createServerEndpoint(); datanodeGroup.init(new RdmaStorageEndpointFactory(datanodeGroup, this)); datanodeServerEndpoint.bind(serverAddr, RdmaConstants.STORAGE_RDMA_BACKLOG); this.allocatedSize = 0; this.fileCount = 0; this.dataDirPath = StorageUtils.getDatanodeDirectory(RdmaConstants.STORAGE_RDMA_DATA_PATH, serverAddr); if (!RdmaConstants.STORAGE_RDMA_PERSISTENT){ StorageUtils.clean(RdmaConstants.STORAGE_RDMA_DATA_PATH, dataDirPath); } }
private void run() throws Exception { System.out.println("ReadServer, size " + size + ", loop " + loop); RdmaServerEndpoint<ReadServerEndpoint> serverEndpoint = group.createServerEndpoint(); InetAddress ipAddress = InetAddress.getByName(host); InetSocketAddress address = new InetSocketAddress(ipAddress, port); serverEndpoint.bind(address, 10); ReadServer.ReadServerEndpoint endpoint = serverEndpoint.accept(); System.out.println("ReadServer, client connected, address " + address.toString()); //let's send a message to the client //in the message we include the RDMA information of a local buffer which we allow the client to read using a one-sided RDMA operation System.out.println("ReadServer, sending message"); endpoint.sendMessage(); //we have to wait for the CQ event, only then we know the message has been sent out endpoint.takeEvent(); //let's wait for the final message to be received. We don't need to check the message itself, just the CQ event is enough. endpoint.takeEvent(); System.out.println("ReadServer, final message"); //close everything endpoint.close(); serverEndpoint.close(); group.close(); }
InetAddress ipAddress = InetAddress.getByName(host); InetSocketAddress address = new InetSocketAddress(ipAddress, port); serverEndpoint.bind(address, 10); SendRecvServer.SendRecvEndpoint endpoint = serverEndpoint.accept(); System.out.println("SendRecvServer, client connected, address " + address.toString());
serverEndpoint.bind(rdmaAddress, 10); System.out.println("RdmaVsTcpBenchmarkServer bound to address " + rdmaAddress.toString());
serverEndpoint.bind(address, 10); System.out.println("SimpleServer::servers bound to address " + address.toString());
serverEndpoint.bind(address, 10); System.out.println("ReadServer::server bound to address" + address.toString());