/// <summary>Convert a protobuf token into a rpc token and set its service.</summary>
 /// <param name="protoToken">the yarn token</param>
 /// <param name="service">the service for the token</param>
 public static Org.Apache.Hadoop.Security.Token.Token <T> ConvertFromYarn <T>(Org.Apache.Hadoop.Yarn.Api.Records.Token
                                                                              protoToken, Text service)
     where T : TokenIdentifier
 {
     Org.Apache.Hadoop.Security.Token.Token <T> token = new Org.Apache.Hadoop.Security.Token.Token
                                                        <T>(((byte[])protoToken.GetIdentifier().Array()), ((byte[])protoToken.GetPassword
                                                                                                               ().Array()), new Text(protoToken.GetKind()), new Text(protoToken.GetService()));
     if (service != null)
     {
         token.SetService(service);
     }
     return(token);
 }
Exemple #2
0
 /// <exception cref="System.IO.IOException"/>
 public static ContainerTokenIdentifier NewContainerTokenIdentifier(Org.Apache.Hadoop.Yarn.Api.Records.Token
                                                                    containerToken)
 {
     Org.Apache.Hadoop.Security.Token.Token <ContainerTokenIdentifier> token = new Org.Apache.Hadoop.Security.Token.Token
                                                                               <ContainerTokenIdentifier>(((byte[])containerToken.GetIdentifier().Array()), ((byte
                                                                                                                                                              [])containerToken.GetPassword().Array()), new Text(containerToken.GetKind()), new
                                                                                                          Text(containerToken.GetService()));
     return(token.DecodeIdentifier());
 }