// pipeline components SaslServerHandler and ResponseEncoder are
// removed, leaving the pipeline the same as in the non-authenticated
// configuration except for the presence of the Authorize component.
return Channels.pipeline(
byteCounter,
new LengthFieldBasedFrameDecoder(1024 * 1024 * 1024, 0, 4, 0, 4),
new RequestDecoder(conf, byteCounter),
// Removed after authentication completes:
saslServerHandlerFactory.newHandler(conf),
new AuthorizeServerHandler(),
requestServerHandlerFactory.newHandler(workerRequestReservedMap,
conf, myTaskInfo),
// Removed after authentication completes:
new ResponseEncoder());
} else {
LOG.info("start: Using Netty without authentication.");
/*end[HADOOP_NON_SECURE]*/
ChannelPipeline pipeline = pipeline();
// Store all connected channels in order to ensure that we can close
// them on stop(), or else stop() may hang waiting for the
// connections to close on their own
pipeline.addLast("connectedChannels",
new SimpleChannelUpstreamHandler() {
@Override
public void channelConnected(ChannelHandlerContext ctx,
ChannelStateEvent e) throws Exception {
super.channelConnected(ctx, e);
accepted.add(e.getChannel());
}
});
pipeline.addLast("serverByteCounter", byteCounter);
pipeline.addLast("requestFrameDecoder",
new LengthFieldBasedFrameDecoder(
1024 * 1024 * 1024, 0, 4, 0, 4));
pipeline.addLast("requestDecoder",
new RequestDecoder(conf, byteCounter));
pipeline.addLast("requestProcessor",
requestServerHandlerFactory.newHandler(