PipelineUtils.addLastWithExecutorCheck(
"length-field-based-frame-decoder",
new LengthFieldBasedFrameDecoder(1024, 0, 4, 0, 4),
handlerToUseExecutionGroup, executionGroup, ch);
PipelineUtils.addLastWithExecutorCheck("request-encoder",
new RequestEncoder(conf), handlerToUseExecutionGroup,
executionGroup, ch);
// The following pipeline component responds to the server's SASL
// tokens with its own responses. Both client and server share the
// same Hadoop Job token, which is used to create the SASL
// tokens to authenticate with each other.
// After authentication finishes, this pipeline component
// is removed.
PipelineUtils.addLastWithExecutorCheck("sasl-client-handler",
new SaslClientHandler(conf), handlerToUseExecutionGroup,
executionGroup, ch);
PipelineUtils.addLastWithExecutorCheck("response-handler",
new ResponseClientHandler(clientRequestIdRequestInfoMap,
conf), handlerToUseExecutionGroup, executionGroup, ch);
} else {
LOG.info("Using Netty without authentication.");
/*end[HADOOP_NON_SECURE]*/
PipelineUtils.addLastWithExecutorCheck("clientInboundByteCounter",
inboundByteCounter, handlerToUseExecutionGroup,
executionGroup, ch);
if (conf.doCompression()) {
PipelineUtils.addLastWithExecutorCheck("compressionDecoder",
conf.getNettyCompressionDecoder(),
handlerToUseExecutionGroup, executionGroup, ch);
}
PipelineUtils.addLastWithExecutorCheck(
"clientOutboundByteCounter",
outboundByteCounter, handlerToUseExecutionGroup,
executionGroup, ch);
if (conf.doCompression()) {
PipelineUtils.addLastWithExecutorCheck("compressionEncoder",
conf.getNettyCompressionEncoder(),
handlerToUseExecutionGroup, executionGroup, ch);
}
PipelineUtils.addLastWithExecutorCheck(
"fixed-length-frame-decoder",
new FixedLengthFrameDecoder(
RequestServerHandler.RESPONSE_BYTES),
handlerToUseExecutionGroup, executionGroup, ch);
PipelineUtils.addLastWithExecutorCheck("request-encoder",
new RequestEncoder(conf), handlerToUseExecutionGroup,
executionGroup, ch);
PipelineUtils.addLastWithExecutorCheck("response-handler",
new ResponseClientHandler(clientRequestIdRequestInfoMap,
conf), handlerToUseExecutionGroup, executionGroup, ch);