コード例 #1
0
        public static Token NewInstance(byte[] identifier, string kind, byte[] password,
                                        string service)
        {
            Token token = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <Token>();

            token.SetIdentifier(ByteBuffer.Wrap(identifier));
            token.SetKind(kind);
            token.SetPassword(ByteBuffer.Wrap(password));
            token.SetService(service);
            return(token);
        }
コード例 #2
0
            public GetDelegationTokenResponse Answer(InvocationOnMock invocation)
            {
                GetDelegationTokenRequest request = (GetDelegationTokenRequest)invocation.GetArguments
                                                        ()[0];

                NUnit.Framework.Assert.AreEqual(masterPrincipal, request.GetRenewer());
                Org.Apache.Hadoop.Yarn.Api.Records.Token token = TestYARNRunner.recordFactory.NewRecordInstance
                                                                 <Org.Apache.Hadoop.Yarn.Api.Records.Token>();
                token.SetKind(string.Empty);
                token.SetService(string.Empty);
                token.SetIdentifier(ByteBuffer.Allocate(0));
                token.SetPassword(ByteBuffer.Allocate(0));
                GetDelegationTokenResponse tokenResponse = TestYARNRunner.recordFactory.NewRecordInstance
                                                           <GetDelegationTokenResponse>();

                tokenResponse.SetDelegationToken(token);
                return(tokenResponse);
            }