public RdmaPassiveEndpointGroup<RdmaEndpoint> createDefaultGroup(int timeout, int maxWR, int maxSge, int cqSize) throws IOException{ RdmaPassiveEndpointGroup<RdmaEndpoint> group = new RdmaPassiveEndpointGroup<RdmaEndpoint>(timeout, maxWR, maxSge, cqSize); group.init(new RawEndpointFactory(group)); return group; }
public StorageEndpoint createEndpoint(InetSocketAddress inetAddress) throws Exception { if (RdmaConstants.STORAGE_RDMA_LOCAL_MAP && CrailUtils.isLocalAddress(inetAddress.getAddress())){ RdmaStorageLocalEndpoint localEndpoint = localCache.get(inetAddress.getAddress()); if (localEndpoint == null){ localEndpoint = new RdmaStorageLocalEndpoint(inetAddress); localCache.put(inetAddress, localEndpoint); } return localEndpoint; } RdmaStoragePassiveEndpoint endpoint = super.createEndpoint(); endpoint.connect(inetAddress, RdmaConstants.STORAGE_RDMA_CONNECTTIMEOUT); return endpoint; }
@Override public void run() { try { this.isAlive = true; LOG.info("rdma storage server started, address " + serverAddr + ", persistent " + RdmaConstants.STORAGE_RDMA_PERSISTENT + ", maxWR " + datanodeGroup.getMaxWR() + ", maxSge " + datanodeGroup.getMaxSge() + ", cqSize " + datanodeGroup.getCqSize()); while(true){ RdmaEndpoint clientEndpoint = datanodeServerEndpoint.accept(); allEndpoints.put(clientEndpoint.getEndpointId(), clientEndpoint); LOG.info("accepting client connection, conncount " + allEndpoints.size()); } } catch(Exception e){ e.printStackTrace(); } this.isAlive = false; }
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("SendRecvClient, size " + size + ", loop " + loop + ", recvQueueSize " + recvQueueSize + ", port " + port); SendRecvClient.SendRecvEndpoint endpoint = group.createEndpoint(); InetAddress ipAddress = InetAddress.getByName(host); InetSocketAddress address = new InetSocketAddress(ipAddress, port); group.close();
private void run() throws Exception { System.out.println("SendRecvServer, size " + size + ", loop " + loop + ", recvQueueSize " + recvQueueSize + ", port " + port); RdmaServerEndpoint<SendRecvServer.SendRecvEndpoint> serverEndpoint = group.createServerEndpoint(); InetAddress ipAddress = InetAddress.getByName(host); InetSocketAddress address = new InetSocketAddress(ipAddress, port); group.close();
private void run() throws Exception { System.out.println("ReadClient, size " + size + ", loop " + loop); ReadClient.ReadClientEndpoint endpoint = group.createEndpoint(); InetAddress ipAddress = InetAddress.getByName(host); InetSocketAddress address = new InetSocketAddress(ipAddress, port); group.close();
public SendRecvClient(String host, int port, int size, int loop, int recvQueueSize) throws IOException{ this.group = new RdmaPassiveEndpointGroup<SendRecvClient.SendRecvEndpoint>(1, recvQueueSize, 1, recvQueueSize*2); this.group.init(this); this.host = host; this.port = port; this.size = size; this.loop = loop; this.recvQueueSize = recvQueueSize; }
public SendRecvServer(String host, int port, int size, int loop, int recvQueueSize) throws IOException{ this.group = new RdmaPassiveEndpointGroup<SendRecvServer.SendRecvEndpoint>(1, recvQueueSize, 1, recvQueueSize*2); this.group.init(this); this.host = host; this.port = port; this.size = size; this.loop = loop; this.recvQueueSize = recvQueueSize; }
public ReadClient(String host, int port, int size, int loop) throws IOException{ this.group = new RdmaPassiveEndpointGroup<ReadClient.ReadClientEndpoint>(1, 10, 4, 40); this.group.init(this); this.host = host; this.port = port; this.size = size; this.loop = loop; }