public HttpPipelineFactory(Configuration conf, Timer timer) throws Exception { SHUFFLE = getShuffle(conf); // TODO Setup SSL Shuffle // if (conf.getBoolean(MRConfig.SHUFFLE_SSL_ENABLED_KEY, // MRConfig.SHUFFLE_SSL_ENABLED_DEFAULT)) { // LOG.info("Encrypted shuffle is enabled."); // sslFactory = new SSLFactory(SSLFactory.Mode.SERVER, conf); // sslFactory.init(); // } this.idleStateHandler = new IdleStateHandler(timer, 0, connectionKeepAliveTimeOut, 0); }
public void run() { try { channelIdle(ctx, state, lastActivityTimeMillis); } catch (Throwable t) { fireExceptionCaught(ctx, t); } } });
public void beforeRemove(ChannelHandlerContext ctx) throws Exception { destroy(ctx); }
@Override public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { // This method will be invoked only if this handler was added // before channelOpen event is fired. If a user adds this handler // after the channelOpen event, initialize() will be called by beforeAdd(). initialize(ctx); ctx.sendUpstream(e); }
public void beforeAdd(ChannelHandlerContext ctx) throws Exception { if (ctx.getPipeline().isAttached()) { // channelOpen event has been fired already, which means // this.channelOpen() will not be invoked. // We have to initialize here instead. initialize(ctx); } else { // channelOpen event has not been fired yet. // this.channelOpen() will be invoked and initialization will occur there. } }
IdleStateHandler idleStateHandler = new IdleStateHandler(NettyUtils.hashedWheelTimer, readTimeout, writeTimeout,
@Override public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { destroy(ctx); ctx.sendUpstream(e); }
@Override public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); pipeline.addLast("idleStateCheck", new IdleStateHandler(timer, 0, 0, MAX_IDLE_SECONDS)); pipeline.addLast("idleCheckHandler", idleCheckHandler); pipeline.addLast("multiplexer", createProtcolMultiplexerDecoder()); return pipeline; }
public ChannelPipeline addHandlers(ChannelPipeline pipeline) { if (null == pipeline) return null; pipeline.addLast("framer",createLengthBasedFrameDecoder()); pipeline.addLast("idleStateCheck", new IdleStateHandler(timer, 0, 0, MAX_IDLE_SECONDS)); pipeline.addLast("idleCheckHandler", idleCheckHandler); pipeline.addLast("eventDecoder", eventDecoder); pipeline.addLast("loginHandler", loginHandler); pipeline.addLast("lengthFieldPrepender",lengthFieldPrepender); return pipeline; }
/** * Instantiates a new my pipeline factory. * * @param timer the timer * @param tcpWorker the tcp worker * @param idleTimeoutSec the idle timeout sec */ public MyPipelineFactory(Timer timer, TcpWorker tcpWorker, int idleTimeoutSec) { this.tcpWorker = tcpWorker; this.idleStateHandler = new IdleStateHandler(timer, 0, 0, idleTimeoutSec); this.myIdleHandler = new MyIdleHandler(tcpWorker); }
/** * Instantiates a new my pipeline factory. * * @param timer * the timer * @param udpWorker * the udp worker */ public UdpPipelineFactory(Timer timer, UdpWorker udpWorker) { this.udpWorker = udpWorker; this.idleStateHandler = new IdleStateHandler(timer, 0, 0, udpWorker.udpMeta.getUdpIdleTimeoutSec()); this.myIdleHandler = new MyIdleHandler(udpWorker); }
public HttpOutboundPipeline (Timer timer) { IDLE_STATE_HANDLER = new IdleStateHandler(timer, IDLE_TIMEOUT_READER, IDLE_TIMEOUT_WRITER, IDLE_TIMEOUT_BOTH); }
public MockEndpoint() { IDLE_STATE_HANDLER = new IdleStateHandler(TIMER, IDLE_TIMEOUT_READER, IDLE_TIMEOUT_WRITER, IDLE_TIMEOUT_BOTH); }
public PcepPipelineFactory(Controller controller) { super(); this.controller = controller; this.idleHandler = new IdleStateHandler(TIMER, DEFAULT_DEAD_TIME, DEFAULT_KEEP_ALIVE_TIME, 0); this.readTimeoutHandler = new ReadTimeoutHandler(TIMER, DEFAULT_WAIT_TIME); }
public HttpPipelineFactory(Configuration conf, Timer timer) throws Exception { SHUFFLE = getShuffle(conf); // TODO Setup SSL Shuffle // if (conf.getBoolean(MRConfig.SHUFFLE_SSL_ENABLED_KEY, // MRConfig.SHUFFLE_SSL_ENABLED_DEFAULT)) { // LOG.info("Encrypted shuffle is enabled."); // sslFactory = new SSLFactory(SSLFactory.Mode.SERVER, conf); // sslFactory.init(); // } this.idleStateHandler = new IdleStateHandler(timer, 0, connectionKeepAliveTimeOut, 0); }
/** * Instantiates a new my pipeline factory. * * @param timer the timer * @param tcpWorker the tcp worker * @param idleTimeoutSec the idle timeout sec */ public MyPipelineFactory(Timer timer, TcpWorker tcpWorker, int idleTimeoutSec) { this.tcpWorker = tcpWorker; this.idleStateHandler = new IdleStateHandler(timer, 0, 0, idleTimeoutSec); this.myIdleHandler = new MyIdleHandler(tcpWorker); }
public PcepPipelineFactory(Controller controller) { super(); this.controller = controller; this.idleHandler = new IdleStateHandler(TIMER, DEFAULT_DEAD_TIME, DEFAULT_KEEP_ALIVE_TIME, 0); this.readTimeoutHandler = new ReadTimeoutHandler(TIMER, DEFAULT_WAIT_TIME); }
RegionClientPipeline() { timeout_handler = new IdleStateHandler(timer, 0, 0, config.getInt("hbase.hbase.ipc.client.connection.idle_timeout")); }
public CommonHttpPipeline(Timer timer) { this.idleStateHandler = new IdleStateHandler(timer, IDLE_TIMEOUT_READER, IDLE_TIMEOUT_WRITER, IDLE_TIMEOUT_BOTH); this.outboundConnectionPool = new CommonsConnectionPool(timer, OUTBOUND_CHANNEL_FACTORY); }
public OpenflowPipelineFactory(Controller controller, ThreadPoolExecutor pipelineExecutor, SSLContext sslContext) { super(); this.controller = controller; this.pipelineExecutor = pipelineExecutor; this.timer = new HashedWheelTimer(); this.idleHandler = new IdleStateHandler(timer, 20, 25, 0); this.readTimeoutHandler = new ReadTimeoutHandler(timer, 30); this.sslContext = sslContext; }