Class SaslDataTransferServer

java.lang.Object
org.apache.hadoop.hdfs.protocol.datatransfer.sasl.SaslDataTransferServer

@Private public class SaslDataTransferServer extends Object
Negotiates SASL for DataTransferProtocol on behalf of a server. There are two possible supported variants of SASL negotiation: either a general-purpose negotiation supporting any quality of protection, or a specialized negotiation that enforces privacy as the quality of protection using a cryptographically strong encryption key. This class is used in the DataNode for handling inbound connections.
  • Constructor Details

    • SaslDataTransferServer

      public SaslDataTransferServer(DNConf dnConf, BlockPoolTokenSecretManager blockPoolTokenSecretManager)
      Creates a new SaslDataTransferServer.
      Parameters:
      dnConf - configuration of DataNode
      blockPoolTokenSecretManager - used for checking block access tokens and encryption keys
  • Method Details

    • receive

      public org.apache.hadoop.hdfs.protocol.datatransfer.IOStreamPair receive(org.apache.hadoop.hdfs.net.Peer peer, OutputStream underlyingOut, InputStream underlyingIn, int xferPort, org.apache.hadoop.hdfs.protocol.DatanodeID datanodeId) throws IOException
      Receives SASL negotiation from a peer on behalf of a server.
      Parameters:
      peer - connection peer
      underlyingOut - connection output stream
      underlyingIn - connection input stream
      xferPort - data transfer port of DataNode accepting connection
      datanodeId - ID of DataNode accepting connection
      Returns:
      new pair of streams, wrapped after SASL negotiation
      Throws:
      IOException - for any error
    • getNegotiatedQOP

      @VisibleForTesting public String getNegotiatedQOP()