/** * Gets filters used by communication. * * @return Filters array. */ private GridNioFilter[] filters() { return new GridNioFilter[] { new GridNioAsyncNotifyFilter(igniteInstanceName, execSvc, log), new HandshakeAndBackpressureFilter(), new HadoopMarshallerFilter(marsh), new GridNioCodecFilter(new GridBufferedParser(directBuf, ByteOrder.nativeOrder()), log, false) }; }
/** * Starts the server. * * @throws IgniteCheckedException If failed. */ public void start() throws IgniteCheckedException { try { String igniteInstanceName = "test"; srv = GridNioServer.<GridClientMessage>builder() .address(InetAddress.getByName("127.0.0.1")) .port(port) .listener(new TestListener()) .logger(log) .selectorCount(2) .igniteInstanceName(igniteInstanceName) .byteOrder(ByteOrder.nativeOrder()) .tcpNoDelay(true) .directBuffer(false) .filters( new GridNioAsyncNotifyFilter(igniteInstanceName, Executors.newFixedThreadPool(2), log), new GridNioCodecFilter(new TestParser(), log, false) ) .build(); } catch (UnknownHostException e) { throw new IgniteCheckedException("Failed to determine localhost address.", e); } srv.start(); }