MAPREDUCE-4920. Use security token protobuf definition from hadoop common. Contributed by Suresh Srinivas.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1429751 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2013-01-07 11:13:26 +00:00
parent 917ff03b2c
commit b8a7a17191
6 changed files with 17 additions and 12 deletions

View File

@ -195,6 +195,9 @@ Release 2.0.3-alpha - Unreleased
applications that YARN's ResourceManager doesn't keep track off anymore
(Derek Dagit via vinodkv)
MAPREDUCE-4920. Use security token protobuf definition from hadoop common.
(Suresh Srinivas via vinodkv)
OPTIMIZATIONS
BUG FIXES

View File

@ -81,6 +81,7 @@
<configuration>
<executable>protoc</executable>
<arguments>
<argument>-I../../../hadoop-common-project/hadoop-common/src/main/proto/</argument>
<argument>-I../../../hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/</argument>
<argument>-Isrc/main/proto/</argument>
<argument>--java_out=target/generated-sources/proto</argument>

View File

@ -20,10 +20,10 @@ package org.apache.hadoop.mapreduce.v2.api.protocolrecords.impl.pb;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.CancelDelegationTokenRequest;
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.CancelDelegationTokenRequestProto;
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.CancelDelegationTokenRequestProtoOrBuilder;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
import org.apache.hadoop.yarn.api.records.DelegationToken;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.DelegationTokenPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.DelegationTokenProto;
public class CancelDelegationTokenRequestPBImpl extends
ProtoBase<CancelDelegationTokenRequestProto> implements
@ -98,11 +98,11 @@ public class CancelDelegationTokenRequestPBImpl extends
}
private DelegationTokenPBImpl convertFromProtoFormat(DelegationTokenProto p) {
private DelegationTokenPBImpl convertFromProtoFormat(TokenProto p) {
return new DelegationTokenPBImpl(p);
}
private DelegationTokenProto convertToProtoFormat(DelegationToken t) {
private TokenProto convertToProtoFormat(DelegationToken t) {
return ((DelegationTokenPBImpl)t).getProto();
}
}

View File

@ -20,10 +20,10 @@ package org.apache.hadoop.mapreduce.v2.api.protocolrecords.impl.pb;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetDelegationTokenResponse;
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.GetDelegationTokenResponseProto;
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.GetDelegationTokenResponseProtoOrBuilder;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
import org.apache.hadoop.yarn.api.records.DelegationToken;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.DelegationTokenPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.DelegationTokenProto;
public class GetDelegationTokenResponsePBImpl extends
@ -99,11 +99,11 @@ public class GetDelegationTokenResponsePBImpl extends
}
private DelegationTokenPBImpl convertFromProtoFormat(DelegationTokenProto p) {
private DelegationTokenPBImpl convertFromProtoFormat(TokenProto p) {
return new DelegationTokenPBImpl(p);
}
private DelegationTokenProto convertToProtoFormat(DelegationToken t) {
private TokenProto convertToProtoFormat(DelegationToken t) {
return ((DelegationTokenPBImpl)t).getProto();
}
}

View File

@ -20,10 +20,10 @@ package org.apache.hadoop.mapreduce.v2.api.protocolrecords.impl.pb;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.RenewDelegationTokenRequest;
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.RenewDelegationTokenRequestProto;
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.RenewDelegationTokenRequestProtoOrBuilder;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
import org.apache.hadoop.yarn.api.records.DelegationToken;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.DelegationTokenPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.DelegationTokenProto;
public class RenewDelegationTokenRequestPBImpl extends
ProtoBase<RenewDelegationTokenRequestProto> implements
@ -96,11 +96,11 @@ public class RenewDelegationTokenRequestPBImpl extends
viaProto = false;
}
private DelegationTokenPBImpl convertFromProtoFormat(DelegationTokenProto p) {
private DelegationTokenPBImpl convertFromProtoFormat(TokenProto p) {
return new DelegationTokenPBImpl(p);
}
private DelegationTokenProto convertToProtoFormat(DelegationToken t) {
private TokenProto convertToProtoFormat(DelegationToken t) {
return ((DelegationTokenPBImpl) t).getProto();
}
}

View File

@ -21,6 +21,7 @@ option java_outer_classname = "MRServiceProtos";
option java_generic_services = true;
option java_generate_equals_and_hash = true;
import "Security.proto";
import "mr_protos.proto";
import "yarn_protos.proto";
@ -81,7 +82,7 @@ message GetDelegationTokenRequestProto {
}
message GetDelegationTokenResponseProto {
optional DelegationTokenProto m_r_delegation_token = 1;
optional hadoop.common.TokenProto m_r_delegation_token = 1;
}
message KillJobRequestProto {
@ -109,7 +110,7 @@ message FailTaskAttemptResponseProto {
}
message RenewDelegationTokenRequestProto {
required DelegationTokenProto delegation_token = 1;
required hadoop.common.TokenProto delegation_token = 1;
}
message RenewDelegationTokenResponseProto {
@ -117,7 +118,7 @@ message RenewDelegationTokenResponseProto {
}
message CancelDelegationTokenRequestProto {
required DelegationTokenProto delegation_token = 1;
required hadoop.common.TokenProto delegation_token = 1;
}
message CancelDelegationTokenResponseProto {