Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/202#discussion_r15409108
  
    --- Diff: 
storm-core/src/jvm/backtype/storm/messaging/netty/StormClientPipelineFactory.java
 ---
    @@ -32,12 +34,24 @@ public ChannelPipeline getPipeline() throws Exception {
             // Create a default pipeline implementation.
             ChannelPipeline pipeline = Channels.pipeline();
     
    -        // Decoder
    -        pipeline.addLast("decoder", new MessageDecoder());
    -        // Encoder
    -        pipeline.addLast("encoder", new MessageEncoder());
    -        // business logic.
    -        pipeline.addLast("handler", new 
StormClientErrorHandler(client.name()));
    +        boolean isNettyAuth = (Boolean) 
this.client.storm_conf.get(Config.STORM_MESSAGING_NETTY_AUTHENTICATION);
    +        if(isNettyAuth) {
    +           // Decoder
    +           pipeline.addLast("decoder", new MessageDecoder());
    +           // Encoder
    +           pipeline.addLast("encoder", new MessageEncoder());
    +           // Authenticate: Removed after authentication completes
    +           pipeline.addLast("saslClientHandler", new 
SaslStormClientHandler(client));
    +           // business logic.
    +           pipeline.addLast("handler", new 
StormClientErrorHandler(client.name()));
    +        } else {
    +           // Decoder
    +           pipeline.addLast("decoder", new MessageDecoder());
    +           // Encoder
    +           pipeline.addLast("encoder", new MessageEncoder());
    +           // business logic.
    +           pipeline.addLast("handler", new 
StormClientErrorHandler(client.name()));
    +        }
    --- End diff --
    
    There is a lot in common between the if and else blocks.  Could we try and 
combine them again, and just have adding the saslClientHandler be in the if 
block?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to