@Override public void initChannel(SocketChannel ch) throws Exception { ChannelPipeline p = ch.pipeline(); if (sslCtx != null) { SslHandler handler = sslCtx.newHandler(ch.alloc()); p.addLast(handler); } ServerConnectionInboundHandler lsh = new ServerConnectionInboundHandler(); // p.addLast(new LoggingHandler(LogLevel.INFO)); p.addLast(new ExceptionLoggingHandler(ch.remoteAddress().toString()), new CommandEncoder(null), new LengthFieldBasedFrameDecoder(MAX_WIRECOMMAND_SIZE, 4, 4), new CommandDecoder(), new AppendDecoder(), lsh); lsh.setRequestProcessor(new AppendProcessor(store, lsh, new PravegaRequestProcessor(store, tableStore, lsh, statsRecorder, tokenVerifier, MetricsProvider.getDynamicLogger(), replyWithStackTraceOnError), statsRecorder, tokenVerifier, MetricsProvider.getDynamicLogger(), replyWithStackTraceOnError)); } });
static EmbeddedChannel createChannel(StreamSegmentStore store) { ServerConnectionInboundHandler lsh = new ServerConnectionInboundHandler(); EmbeddedChannel channel = new EmbeddedChannel(new ExceptionLoggingHandler(""), new CommandEncoder(null), new LengthFieldBasedFrameDecoder(MAX_WIRECOMMAND_SIZE, 4, 4), new CommandDecoder(), new AppendDecoder(), lsh); lsh.setRequestProcessor(new AppendProcessor(store, lsh, new PravegaRequestProcessor(store, mock(TableStore.class), lsh), null)); return channel; }
static EmbeddedChannel createChannel(StreamSegmentStore store) { ServerConnectionInboundHandler lsh = new ServerConnectionInboundHandler(); EmbeddedChannel channel = new EmbeddedChannel(new ExceptionLoggingHandler(""), new CommandEncoder(null), new LengthFieldBasedFrameDecoder(MAX_WIRECOMMAND_SIZE, 4, 4), new CommandDecoder(), new AppendDecoder(), lsh); lsh.setRequestProcessor(new AppendProcessor(store, lsh, new PravegaRequestProcessor(store, mock(TableStore.class), lsh), null)); return channel; }