Class FanOutOneBlockAsyncDFSOutputSaslHelper.SaslNegotiateHandler
java.lang.Object
org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerAdapter
org.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
org.apache.hbase.thirdparty.io.netty.channel.ChannelDuplexHandler
org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputSaslHelper.SaslNegotiateHandler
- All Implemented Interfaces:
org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
,org.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandler
,org.apache.hbase.thirdparty.io.netty.channel.ChannelOutboundHandler
- Enclosing class:
- FanOutOneBlockAsyncDFSOutputSaslHelper
private static final class FanOutOneBlockAsyncDFSOutputSaslHelper.SaslNegotiateHandler
extends org.apache.hbase.thirdparty.io.netty.channel.ChannelDuplexHandler
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
The asyncfs subsystem emulates a HDFS client by sending protobuf messages via netty.Nested classes/interfaces inherited from interface org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.apache.hadoop.conf.Configuration
private final org.apache.hadoop.hdfs.DFSClient
private final org.apache.hbase.thirdparty.io.netty.util.concurrent.Promise<Void>
private final SaslClient
private int
private final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
channelInactive
(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx) void
channelRead
(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, Object msg) private void
check
(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.DataTransferEncryptorMessageProto proto) private void
void
exceptionCaught
(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, Throwable cause) private org.apache.hadoop.crypto.CipherOption
getCipherOption
(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.DataTransferEncryptorMessageProto proto, boolean isNegotiatedQopPrivacy, SaslClient saslClient) private List<org.apache.hadoop.crypto.CipherOption>
private String
void
handlerAdded
(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx) private boolean
private boolean
private void
sendSaslMessage
(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, byte[] payload) private void
sendSaslMessage
(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, byte[] payload, List<org.apache.hadoop.crypto.CipherOption> options) private org.apache.hadoop.crypto.CipherOption
unwrap
(org.apache.hadoop.crypto.CipherOption option, SaslClient saslClient) void
userEventTriggered
(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, Object evt) private boolean
useWrap()
Methods inherited from class org.apache.hbase.thirdparty.io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read, write
Methods inherited from class org.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged
Methods inherited from class org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
handlerRemoved
-
Field Details
-
conf
-
saslProps
-
saslClient
-
timeoutMs
-
promise
-
dfsClient
-
step
-
-
Constructor Details
-
SaslNegotiateHandler
public SaslNegotiateHandler(org.apache.hadoop.conf.Configuration conf, String username, char[] password, Map<String, String> saslProps, int timeoutMs, org.apache.hbase.thirdparty.io.netty.util.concurrent.Promise<Void> promise, org.apache.hadoop.hdfs.DFSClient dfsClient) throws SaslException- Throws:
SaslException
-
-
Method Details
-
sendSaslMessage
private void sendSaslMessage(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, byte[] payload) throws IOException - Throws:
IOException
-
getCipherOptions
- Throws:
IOException
-
sendSaslMessage
private void sendSaslMessage(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, byte[] payload, List<org.apache.hadoop.crypto.CipherOption> options) throws IOException - Throws:
IOException
-
handlerAdded
public void handlerAdded(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx) throws Exception - Specified by:
handlerAdded
in interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
- Overrides:
handlerAdded
in classorg.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerAdapter
- Throws:
Exception
-
channelInactive
public void channelInactive(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx) throws Exception - Specified by:
channelInactive
in interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandler
- Overrides:
channelInactive
in classorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
check
private void check(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.DataTransferEncryptorMessageProto proto) throws IOException - Throws:
IOException
-
getNegotiatedQop
-
isNegotiatedQopPrivacy
-
requestedQopContainsPrivacy
-
checkSaslComplete
- Throws:
IOException
-
useWrap
-
unwrap
private org.apache.hadoop.crypto.CipherOption unwrap(org.apache.hadoop.crypto.CipherOption option, SaslClient saslClient) throws IOException - Throws:
IOException
-
getCipherOption
private org.apache.hadoop.crypto.CipherOption getCipherOption(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.DataTransferEncryptorMessageProto proto, boolean isNegotiatedQopPrivacy, SaslClient saslClient) throws IOException - Throws:
IOException
-
channelRead
public void channelRead(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception - Specified by:
channelRead
in interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
exceptionCaught
public void exceptionCaught(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception - Specified by:
exceptionCaught
in interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
- Specified by:
exceptionCaught
in interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandler
- Overrides:
exceptionCaught
in classorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
userEventTriggered
public void userEventTriggered(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, Object evt) throws Exception - Specified by:
userEventTriggered
in interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandler
- Overrides:
userEventTriggered
in classorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-