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:
parent
917ff03b2c
commit
b8a7a17191
|
@ -195,6 +195,9 @@ Release 2.0.3-alpha - Unreleased
|
||||||
applications that YARN's ResourceManager doesn't keep track off anymore
|
applications that YARN's ResourceManager doesn't keep track off anymore
|
||||||
(Derek Dagit via vinodkv)
|
(Derek Dagit via vinodkv)
|
||||||
|
|
||||||
|
MAPREDUCE-4920. Use security token protobuf definition from hadoop common.
|
||||||
|
(Suresh Srinivas via vinodkv)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -81,6 +81,7 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<executable>protoc</executable>
|
<executable>protoc</executable>
|
||||||
<arguments>
|
<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>-I../../../hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/</argument>
|
||||||
<argument>-Isrc/main/proto/</argument>
|
<argument>-Isrc/main/proto/</argument>
|
||||||
<argument>--java_out=target/generated-sources/proto</argument>
|
<argument>--java_out=target/generated-sources/proto</argument>
|
||||||
|
|
|
@ -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.api.protocolrecords.CancelDelegationTokenRequest;
|
||||||
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.CancelDelegationTokenRequestProto;
|
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.CancelDelegationTokenRequestProto;
|
||||||
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.CancelDelegationTokenRequestProtoOrBuilder;
|
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.DelegationToken;
|
||||||
import org.apache.hadoop.yarn.api.records.ProtoBase;
|
import org.apache.hadoop.yarn.api.records.ProtoBase;
|
||||||
import org.apache.hadoop.yarn.api.records.impl.pb.DelegationTokenPBImpl;
|
import org.apache.hadoop.yarn.api.records.impl.pb.DelegationTokenPBImpl;
|
||||||
import org.apache.hadoop.yarn.proto.YarnProtos.DelegationTokenProto;
|
|
||||||
|
|
||||||
public class CancelDelegationTokenRequestPBImpl extends
|
public class CancelDelegationTokenRequestPBImpl extends
|
||||||
ProtoBase<CancelDelegationTokenRequestProto> implements
|
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);
|
return new DelegationTokenPBImpl(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DelegationTokenProto convertToProtoFormat(DelegationToken t) {
|
private TokenProto convertToProtoFormat(DelegationToken t) {
|
||||||
return ((DelegationTokenPBImpl)t).getProto();
|
return ((DelegationTokenPBImpl)t).getProto();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.api.protocolrecords.GetDelegationTokenResponse;
|
||||||
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.GetDelegationTokenResponseProto;
|
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.GetDelegationTokenResponseProto;
|
||||||
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.GetDelegationTokenResponseProtoOrBuilder;
|
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.DelegationToken;
|
||||||
import org.apache.hadoop.yarn.api.records.ProtoBase;
|
import org.apache.hadoop.yarn.api.records.ProtoBase;
|
||||||
import org.apache.hadoop.yarn.api.records.impl.pb.DelegationTokenPBImpl;
|
import org.apache.hadoop.yarn.api.records.impl.pb.DelegationTokenPBImpl;
|
||||||
import org.apache.hadoop.yarn.proto.YarnProtos.DelegationTokenProto;
|
|
||||||
|
|
||||||
|
|
||||||
public class GetDelegationTokenResponsePBImpl extends
|
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);
|
return new DelegationTokenPBImpl(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DelegationTokenProto convertToProtoFormat(DelegationToken t) {
|
private TokenProto convertToProtoFormat(DelegationToken t) {
|
||||||
return ((DelegationTokenPBImpl)t).getProto();
|
return ((DelegationTokenPBImpl)t).getProto();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.api.protocolrecords.RenewDelegationTokenRequest;
|
||||||
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.RenewDelegationTokenRequestProto;
|
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.RenewDelegationTokenRequestProto;
|
||||||
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.RenewDelegationTokenRequestProtoOrBuilder;
|
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.DelegationToken;
|
||||||
import org.apache.hadoop.yarn.api.records.ProtoBase;
|
import org.apache.hadoop.yarn.api.records.ProtoBase;
|
||||||
import org.apache.hadoop.yarn.api.records.impl.pb.DelegationTokenPBImpl;
|
import org.apache.hadoop.yarn.api.records.impl.pb.DelegationTokenPBImpl;
|
||||||
import org.apache.hadoop.yarn.proto.YarnProtos.DelegationTokenProto;
|
|
||||||
|
|
||||||
public class RenewDelegationTokenRequestPBImpl extends
|
public class RenewDelegationTokenRequestPBImpl extends
|
||||||
ProtoBase<RenewDelegationTokenRequestProto> implements
|
ProtoBase<RenewDelegationTokenRequestProto> implements
|
||||||
|
@ -96,11 +96,11 @@ public class RenewDelegationTokenRequestPBImpl extends
|
||||||
viaProto = false;
|
viaProto = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DelegationTokenPBImpl convertFromProtoFormat(DelegationTokenProto p) {
|
private DelegationTokenPBImpl convertFromProtoFormat(TokenProto p) {
|
||||||
return new DelegationTokenPBImpl(p);
|
return new DelegationTokenPBImpl(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DelegationTokenProto convertToProtoFormat(DelegationToken t) {
|
private TokenProto convertToProtoFormat(DelegationToken t) {
|
||||||
return ((DelegationTokenPBImpl) t).getProto();
|
return ((DelegationTokenPBImpl) t).getProto();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ option java_outer_classname = "MRServiceProtos";
|
||||||
option java_generic_services = true;
|
option java_generic_services = true;
|
||||||
option java_generate_equals_and_hash = true;
|
option java_generate_equals_and_hash = true;
|
||||||
|
|
||||||
|
import "Security.proto";
|
||||||
import "mr_protos.proto";
|
import "mr_protos.proto";
|
||||||
import "yarn_protos.proto";
|
import "yarn_protos.proto";
|
||||||
|
|
||||||
|
@ -81,7 +82,7 @@ message GetDelegationTokenRequestProto {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetDelegationTokenResponseProto {
|
message GetDelegationTokenResponseProto {
|
||||||
optional DelegationTokenProto m_r_delegation_token = 1;
|
optional hadoop.common.TokenProto m_r_delegation_token = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message KillJobRequestProto {
|
message KillJobRequestProto {
|
||||||
|
@ -109,7 +110,7 @@ message FailTaskAttemptResponseProto {
|
||||||
}
|
}
|
||||||
|
|
||||||
message RenewDelegationTokenRequestProto {
|
message RenewDelegationTokenRequestProto {
|
||||||
required DelegationTokenProto delegation_token = 1;
|
required hadoop.common.TokenProto delegation_token = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message RenewDelegationTokenResponseProto {
|
message RenewDelegationTokenResponseProto {
|
||||||
|
@ -117,7 +118,7 @@ message RenewDelegationTokenResponseProto {
|
||||||
}
|
}
|
||||||
|
|
||||||
message CancelDelegationTokenRequestProto {
|
message CancelDelegationTokenRequestProto {
|
||||||
required DelegationTokenProto delegation_token = 1;
|
required hadoop.common.TokenProto delegation_token = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CancelDelegationTokenResponseProto {
|
message CancelDelegationTokenResponseProto {
|
||||||
|
|
Loading…
Reference in New Issue