From 9a87b2f7feefe766cddf11e23c3410da244a3f58 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Mon, 7 Jan 2013 11:15:10 +0000 Subject: [PATCH] MAPREDUCE-4920. Use security token protobuf definition from hadoop common. Contributed by Suresh Srinivas. svn merge --ignore-ancestry -c 1429751 ../../trunk/ git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1429752 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../hadoop-mapreduce-client-common/pom.xml | 1 + .../impl/pb/CancelDelegationTokenRequestPBImpl.java | 6 +++--- .../impl/pb/GetDelegationTokenResponsePBImpl.java | 6 +++--- .../impl/pb/RenewDelegationTokenRequestPBImpl.java | 6 +++--- .../src/main/proto/mr_service_protos.proto | 7 ++++--- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 1b259afdeed..30494cd00b0 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -30,6 +30,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 diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/pom.xml index 93c6a68924e..826e0132079 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/pom.xml +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/pom.xml @@ -81,6 +81,7 @@ protoc + -I../../../hadoop-common-project/hadoop-common/src/main/proto/ -I../../../hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/ -Isrc/main/proto/ --java_out=target/generated-sources/proto diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/CancelDelegationTokenRequestPBImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/CancelDelegationTokenRequestPBImpl.java index e9e196bbbf0..68ffcccf28f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/CancelDelegationTokenRequestPBImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/CancelDelegationTokenRequestPBImpl.java @@ -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 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(); } } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/GetDelegationTokenResponsePBImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/GetDelegationTokenResponsePBImpl.java index 33eecc84cec..59675225734 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/GetDelegationTokenResponsePBImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/GetDelegationTokenResponsePBImpl.java @@ -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(); } } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/RenewDelegationTokenRequestPBImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/RenewDelegationTokenRequestPBImpl.java index 26777c6b1e6..7d9017d9356 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/RenewDelegationTokenRequestPBImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/RenewDelegationTokenRequestPBImpl.java @@ -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 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(); } } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/proto/mr_service_protos.proto b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/proto/mr_service_protos.proto index f875fcb26bf..12c05209f3d 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/proto/mr_service_protos.proto +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/proto/mr_service_protos.proto @@ -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 {