public void run() { try { while (true) { NaRPCServerChannel endpoint = serverEndpoint.accept(); LOG.info("new connection from " + endpoint.address()); } } catch (Exception e) { e.printStackTrace(); } } }
public NaRPCServerEndpoint<R,T> createServerEndpoint() throws IOException{ return new NaRPCServerEndpoint<R,T>(this); }
@Override public void init(CrailConfiguration conf, String[] args) throws Exception { TcpStorageConstants.updateConstants(conf); this.serverGroup = new NaRPCServerGroup<TcpStorageRequest, TcpStorageResponse>(this, TcpStorageConstants.STORAGE_TCP_QUEUE_DEPTH, (int) CrailConstants.BLOCK_SIZE*2, false); this.serverEndpoint = serverGroup.createServerEndpoint(); this.address = getDataNodeAddress(); serverEndpoint.bind(address); this.alive = false; this.regions = TcpStorageConstants.STORAGE_TCP_STORAGE_LIMIT/TcpStorageConstants.STORAGE_TCP_ALLOCATION_SIZE; this.keys = 0; this.dataBuffers = new ConcurrentHashMap<Integer, ByteBuffer>(); this.dataDirPath = getDatanodeDirectory(address); clean(); }
@Override public void init(CrailConfiguration conf, String[] args) throws Exception { TcpStorageConstants.init(conf, args); this.serverGroup = new NaRPCServerGroup<TcpStorageRequest, TcpStorageResponse>(this, TcpStorageConstants.STORAGE_TCP_QUEUE_DEPTH, (int) CrailConstants.BLOCK_SIZE*2, false, TcpStorageConstants.STORAGE_TCP_CORES); this.serverEndpoint = serverGroup.createServerEndpoint(); this.address = StorageUtils.getDataNodeAddress(TcpStorageConstants.STORAGE_TCP_INTERFACE, TcpStorageConstants.STORAGE_TCP_PORT); serverEndpoint.bind(address); this.alive = false; this.regions = TcpStorageConstants.STORAGE_TCP_STORAGE_LIMIT/TcpStorageConstants.STORAGE_TCP_ALLOCATION_SIZE; this.keys = 0; this.dataBuffers = new ConcurrentHashMap<Integer, ByteBuffer>(); this.dataDirPath = StorageUtils.getDatanodeDirectory(TcpStorageConstants.STORAGE_TCP_DATA_PATH, address); StorageUtils.clean(TcpStorageConstants.STORAGE_TCP_DATA_PATH, dataDirPath); }
public void run() { try { while (true) { NaRPCServerChannel endpoint = serverEndpoint.accept(); LOG.info("new connection from " + endpoint.address()); } } catch (Exception e) { e.printStackTrace(); } } }
@Override public void init(CrailConfiguration conf, String[] arg1) throws Exception { TcpRpcConstants.updateConstants(conf); TcpRpcConstants.verify(); this.serverGroup = new NaRPCServerGroup<TcpNameNodeRequest, TcpNameNodeResponse>( dispatcher, TcpRpcConstants.NAMENODE_TCP_QUEUEDEPTH, TcpRpcConstants.NAMENODE_TCP_MESSAGESIZE, true); this.serverEndpoint = serverGroup.createServerEndpoint(); InetSocketAddress inetSocketAddress = CrailUtils.getNameNodeAddress(); serverEndpoint.bind(inetSocketAddress); }
@Override public void run() { try { LOG.info("running TCP storage server, address " + address); this.alive = true; while(true){ NaRPCServerChannel endpoint = serverEndpoint.accept(); LOG.info("new connection " + endpoint.address()); } } catch(Exception e){ e.printStackTrace(); } }
@Override public void init(CrailConfiguration conf, String[] arg1) throws Exception { TcpRpcConstants.updateConstants(conf); TcpRpcConstants.verify(); this.serverGroup = new NaRPCServerGroup<TcpNameNodeRequest, TcpNameNodeResponse>( dispatcher, TcpRpcConstants.NAMENODE_TCP_QUEUEDEPTH, TcpRpcConstants.NAMENODE_TCP_MESSAGESIZE, true, TcpRpcConstants.NAMENODE_TCP_CORES); this.serverEndpoint = serverGroup.createServerEndpoint(); InetSocketAddress inetSocketAddress = CrailUtils.getNameNodeAddress(); serverEndpoint.bind(inetSocketAddress); }
@Override public void run() { try { LOG.info("running TCP storage server, address " + address); this.alive = true; while(true){ NaRPCServerChannel endpoint = serverEndpoint.accept(); LOG.info("new connection " + endpoint.address()); } } catch(Exception e){ e.printStackTrace(); } }