Search in sources :

Example 6 with TokenProto

use of org.apache.hadoop.security.proto.SecurityProtos.TokenProto in project hadoop by apache.

the class ShuffleHandler method recoverJobShuffleInfo.

private void recoverJobShuffleInfo(String jobIdStr, byte[] data) throws IOException {
    JobID jobId;
    try {
        jobId = JobID.forName(jobIdStr);
    } catch (IllegalArgumentException e) {
        throw new IOException("Bad job ID " + jobIdStr + " in state store", e);
    }
    JobShuffleInfoProto proto = JobShuffleInfoProto.parseFrom(data);
    String user = proto.getUser();
    TokenProto tokenProto = proto.getJobToken();
    Token<JobTokenIdentifier> jobToken = new Token<JobTokenIdentifier>(tokenProto.getIdentifier().toByteArray(), tokenProto.getPassword().toByteArray(), new Text(tokenProto.getKind()), new Text(tokenProto.getService()));
    addJobToken(jobId, user, jobToken);
}
Also used : JobShuffleInfoProto(org.apache.hadoop.mapred.proto.ShuffleHandlerRecoveryProtos.JobShuffleInfoProto) TokenProto(org.apache.hadoop.security.proto.SecurityProtos.TokenProto) JobTokenIdentifier(org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier) Token(org.apache.hadoop.security.token.Token) Text(org.apache.hadoop.io.Text) IOException(java.io.IOException) JniDBFactory.asString(org.fusesource.leveldbjni.JniDBFactory.asString) ByteString(com.google.protobuf.ByteString)

Aggregations

TokenProto (org.apache.hadoop.security.proto.SecurityProtos.TokenProto)6 Token (org.apache.hadoop.security.token.Token)4 ByteString (com.google.protobuf.ByteString)2 IOException (java.io.IOException)2 Text (org.apache.hadoop.io.Text)2 JobShuffleInfoProto (org.apache.hadoop.mapred.proto.ShuffleHandlerRecoveryProtos.JobShuffleInfoProto)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 StorageType (org.apache.hadoop.fs.StorageType)1 DatanodeInfo (org.apache.hadoop.hdfs.protocol.DatanodeInfo)1 ExtendedBlock (org.apache.hadoop.hdfs.protocol.ExtendedBlock)1 LocatedBlock (org.apache.hadoop.hdfs.protocol.LocatedBlock)1 LocatedStripedBlock (org.apache.hadoop.hdfs.protocol.LocatedStripedBlock)1 DatanodeInfoProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.DatanodeInfoProto)1 ExtendedBlockProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.ExtendedBlockProto)1 BlockTokenIdentifier (org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier)1 JobTokenIdentifier (org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier)1 IncreaseContainersResourceRequestProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServiceProtos.IncreaseContainersResourceRequestProtoOrBuilder)1 JniDBFactory.asString (org.fusesource.leveldbjni.JniDBFactory.asString)1