public void init(RdmaEndpointFactory<C> factory){ this.closed.set(false); this.factory = factory; cmProcessor.start(); }
public synchronized final C createEndpoint() throws IOException { RdmaCmId idPriv = cmProcessor.createId(RdmaCm.RDMA_PS_TCP); C ep = factory.createEndpoint(idPriv, false); clientEndpointMap.put(idPriv, ep); return ep; }
public RdmaEndpointGroup(int timeout) throws IOException{ this.endpointProvider = RdmaEndpointProvider.getEndpointProvider(); this.serverEndpointMap = new HashMap<RdmaCmId, RdmaServerEndpoint<C>>(); this.clientEndpointMap = new HashMap<RdmaCmId, C>(); this.cmProcessor = new RdmaCmProcessor(this, timeout); this.closed = new AtomicBoolean(true); this.connParam = new RdmaConnParam(); }
public synchronized void close() throws IOException, InterruptedException { logger.info("shutting down group"); if (closed.get()){ return; } LinkedList<RdmaEndpoint> clientEps = new LinkedList<RdmaEndpoint>(); for (RdmaEndpoint ep : clientEndpointMap.values()) { clientEps.add(ep); } for (RdmaEndpoint ep : clientEps){ ep.close(); } LinkedList<RdmaServerEndpoint<C>> serverEps = new LinkedList<RdmaServerEndpoint<C>>(); for (RdmaServerEndpoint<C> ep : serverEndpointMap.values()) { serverEps.add(ep); } for (RdmaServerEndpoint<C> ep: serverEps){ ep.close(); } cmProcessor.close(); closed.set(true); logger.info("shutting down group done"); }
public synchronized final RdmaServerEndpoint<C> createServerEndpoint() throws IOException{ RdmaCmId idPriv = cmProcessor.createId(RdmaCm.RDMA_PS_TCP); RdmaServerEndpoint<C> ep = new RdmaServerEndpoint<C>(this, idPriv); serverEndpointMap.put(idPriv, ep); return ep; }