コード例 #1
0
                                                                 > DelegationToken()
        {
            string delegation = Param(DelegationParam.Name);

            Org.Apache.Hadoop.Security.Token.Token <DelegationTokenIdentifier> token = new Org.Apache.Hadoop.Security.Token.Token
                                                                                       <DelegationTokenIdentifier>();
            token.DecodeFromUrlString(delegation);
            URI  nnUri     = URI.Create(HdfsConstants.HdfsUriScheme + "://" + NamenodeId());
            bool isLogical = HAUtil.IsLogicalUri(conf, nnUri);

            if (isLogical)
            {
                token.SetService(HAUtil.BuildTokenServiceForLogicalUri(nnUri, HdfsConstants.HdfsUriScheme
                                                                       ));
            }
            else
            {
                token.SetService(SecurityUtil.BuildTokenService(nnUri));
            }
            return(token);
        }