Search in sources :

Example 1 with LengthFieldBasedFrameDecoder

use of org.apache.hbase.thirdparty.io.netty.handler.codec.LengthFieldBasedFrameDecoder in project hbase by apache.

the class NettyHBaseSaslRpcClient method setupSaslHandler.

public void setupSaslHandler(ChannelPipeline p) {
    String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP);
    LOG.trace("SASL client context established. Negotiated QoP {}", qop);
    if (qop == null || "auth".equalsIgnoreCase(qop)) {
        return;
    }
    // add wrap and unwrap handlers to pipeline.
    p.addFirst(new SaslWrapHandler(saslClient), new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4), new SaslUnwrapHandler(saslClient));
}
Also used : LengthFieldBasedFrameDecoder(org.apache.hbase.thirdparty.io.netty.handler.codec.LengthFieldBasedFrameDecoder)

Example 2 with LengthFieldBasedFrameDecoder

use of org.apache.hbase.thirdparty.io.netty.handler.codec.LengthFieldBasedFrameDecoder in project hbase by apache.

the class NettyRpcConnection method established.

private void established(Channel ch) throws IOException {
    assert eventLoop.inEventLoop();
    ChannelPipeline p = ch.pipeline();
    String addBeforeHandler = p.context(BufferCallBeforeInitHandler.class).name();
    p.addBefore(addBeforeHandler, null, new IdleStateHandler(0, rpcClient.minIdleTimeBeforeClose, 0, TimeUnit.MILLISECONDS));
    p.addBefore(addBeforeHandler, null, new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4));
    p.addBefore(addBeforeHandler, null, new NettyRpcDuplexHandler(this, rpcClient.cellBlockBuilder, codec, compressor));
    p.fireUserEventTriggered(BufferCallEvent.success());
}
Also used : IdleStateHandler(org.apache.hbase.thirdparty.io.netty.handler.timeout.IdleStateHandler) LengthFieldBasedFrameDecoder(org.apache.hbase.thirdparty.io.netty.handler.codec.LengthFieldBasedFrameDecoder) ChannelPipeline(org.apache.hbase.thirdparty.io.netty.channel.ChannelPipeline)

Aggregations

LengthFieldBasedFrameDecoder (org.apache.hbase.thirdparty.io.netty.handler.codec.LengthFieldBasedFrameDecoder)2 ChannelPipeline (org.apache.hbase.thirdparty.io.netty.channel.ChannelPipeline)1 IdleStateHandler (org.apache.hbase.thirdparty.io.netty.handler.timeout.IdleStateHandler)1