You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-commits@hadoop.apache.org by ss...@apache.org on 2012/03/29 04:02:19 UTC
svn commit: r1306689 [1/2] - in
/hadoop/common/trunk/hadoop-mapreduce-project: ./
hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/
hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/or...
Author: sseth
Date: Thu Mar 29 02:02:17 2012
New Revision: 1306689
URL: http://svn.apache.org/viewvc?rev=1306689&view=rev
Log:
REDUCE-3955. Change MR to use ProtobufRpcEngine from hadoop-common instead of ProtoOverHadoopRpcEngine. (Contributed by Jitendra Nath Pandey)
Added:
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/HSClientProtocolPB.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/MRClientProtocolPB.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocolPB.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocolPB.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManagerPB.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/ResourceTrackerPB.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/api/LocalizationProtocolPB.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/api/RMAdminProtocolPB.java
Removed:
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/ProtoOverHadoopRpcEngine.java
Modified:
hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRClientSecurityInfo.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/ClientHSPolicyProvider.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/MRAMPolicyProvider.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/HSClientProtocolPBClientImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/MRClientProtocolPBClientImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/HSClientProtocolPBServiceImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/MRClientProtocolPBServiceImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/client/ClientHSSecurityInfo.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/yarn/proto/HSClientProtocol.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/impl/pb/YarnRemoteExceptionPBImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/AMRMProtocolPBClientImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ContainerManagerPBClientImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/AMRMProtocolPBServiceImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ContainerManagerPBServiceImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/factories/impl/pb/RpcServerFactoryPBImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/ContainerManagerSecurityInfo.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/SchedulerSecurityInfo.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/client/ClientRMSecurityInfo.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/TestRPC.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/RMNMSecurityInfoClass.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/impl/pb/client/ResourceTrackerPBClientImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/impl/pb/service/ResourceTrackerPBServiceImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/api/impl/pb/client/LocalizationProtocolPBClientImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/api/impl/pb/service/LocalizationProtocolPBServiceImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/security/LocalizerSecurityInfo.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/security/authorize/NMPolicyProvider.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/api/impl/pb/client/RMAdminProtocolPBClientImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/api/impl/pb/service/RMAdminProtocolPBServiceImpl.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/admin/AdminSecurityInfo.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/authorize/RMPolicyProvider.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAMAuthorization.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationACLs.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java
Modified: hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt Thu Mar 29 02:02:17 2012
@@ -133,6 +133,9 @@ Release 2.0.0 - UNRELEASED
MAPREDUCE-3353. Add a channel between RM and AM to get information on
nodes. (Bikas Saha via acmurthy)
+ MAPREDUCE-3955. Change MR to use ProtobufRpcEngine from hadoop-common
+ instead of ProtoOverHadoopRpcEngine. (Jitendra Nath Pandey via sseth)
+
OPTIMIZATIONS
BUG FIXES
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRClientSecurityInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRClientSecurityInfo.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRClientSecurityInfo.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRClientSecurityInfo.java Thu Mar 29 02:02:17 2012
@@ -21,12 +21,12 @@ package org.apache.hadoop.mapreduce.v2.a
import java.lang.annotation.Annotation;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapreduce.v2.api.MRClientProtocolPB;
import org.apache.hadoop.security.KerberosInfo;
import org.apache.hadoop.security.SecurityInfo;
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.hadoop.security.token.TokenInfo;
import org.apache.hadoop.security.token.TokenSelector;
-import org.apache.hadoop.yarn.proto.MRClientProtocol;
import org.apache.hadoop.yarn.security.client.ClientTokenSelector;
public class MRClientSecurityInfo extends SecurityInfo {
@@ -38,7 +38,7 @@ public class MRClientSecurityInfo extend
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
- if (!protocol.equals(MRClientProtocol.MRClientProtocolService.BlockingInterface.class)) {
+ if (!protocol.equals(MRClientProtocolPB.class)) {
return null;
}
return new TokenInfo() {
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/ClientHSPolicyProvider.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/ClientHSPolicyProvider.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/ClientHSPolicyProvider.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/ClientHSPolicyProvider.java Thu Mar 29 02:02:17 2012
@@ -19,10 +19,10 @@ package org.apache.hadoop.mapreduce.v2.a
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.mapreduce.v2.api.HSClientProtocolPB;
import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig;
import org.apache.hadoop.security.authorize.PolicyProvider;
import org.apache.hadoop.security.authorize.Service;
-import org.apache.hadoop.yarn.proto.HSClientProtocol;
/**
* {@link PolicyProvider} for YARN MapReduce protocols.
@@ -35,7 +35,7 @@ public class ClientHSPolicyProvider exte
new Service[] {
new Service(
JHAdminConfig.MR_HS_SECURITY_SERVICE_AUTHORIZATION,
- HSClientProtocol.HSClientProtocolService.BlockingInterface.class)
+ HSClientProtocolPB.class)
};
@Override
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/MRAMPolicyProvider.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/MRAMPolicyProvider.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/MRAMPolicyProvider.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/MRAMPolicyProvider.java Thu Mar 29 02:02:17 2012
@@ -21,9 +21,9 @@ import org.apache.hadoop.classification.
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.mapred.TaskUmbilicalProtocol;
import org.apache.hadoop.mapreduce.MRJobConfig;
+import org.apache.hadoop.mapreduce.v2.api.MRClientProtocolPB;
import org.apache.hadoop.security.authorize.PolicyProvider;
import org.apache.hadoop.security.authorize.Service;
-import org.apache.hadoop.yarn.proto.MRClientProtocol;
/**
* {@link PolicyProvider} for YARN MapReduce protocols.
@@ -39,7 +39,7 @@ public class MRAMPolicyProvider extends
TaskUmbilicalProtocol.class),
new Service(
MRJobConfig.MR_AM_SECURITY_SERVICE_AUTHORIZATION_CLIENT,
- MRClientProtocol.MRClientProtocolService.BlockingInterface.class)
+ MRClientProtocolPB.class)
};
@Override
Added: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/HSClientProtocolPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/HSClientProtocolPB.java?rev=1306689&view=auto
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/HSClientProtocolPB.java (added)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/HSClientProtocolPB.java Thu Mar 29 02:02:17 2012
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.mapreduce.v2.api;
+
+import org.apache.hadoop.ipc.ProtocolInfo;
+import org.apache.hadoop.yarn.proto.HSClientProtocol.HSClientProtocolService;
+
+@ProtocolInfo(protocolName = "org.apache.hadoop.mapreduce.v2.api.HSClientProtocolPB",
+ protocolVersion = 1)
+public interface HSClientProtocolPB extends HSClientProtocolService.BlockingInterface {
+
+}
Added: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/MRClientProtocolPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/MRClientProtocolPB.java?rev=1306689&view=auto
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/MRClientProtocolPB.java (added)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/MRClientProtocolPB.java Thu Mar 29 02:02:17 2012
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.mapreduce.v2.api;
+
+import org.apache.hadoop.ipc.ProtocolInfo;
+import org.apache.hadoop.yarn.proto.MRClientProtocol.MRClientProtocolService;
+
+@ProtocolInfo(
+ protocolName = "org.apache.hadoop.mapreduce.v2.api.MRClientProtocolPB",
+ protocolVersion = 1)
+public interface MRClientProtocolPB extends MRClientProtocolService.BlockingInterface {
+
+}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/HSClientProtocolPBClientImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/HSClientProtocolPBClientImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/HSClientProtocolPBClientImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/HSClientProtocolPBClientImpl.java Thu Mar 29 02:02:17 2012
@@ -22,10 +22,10 @@ import java.io.IOException;
import java.net.InetSocketAddress;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.ipc.ProtobufRpcEngine;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.mapreduce.v2.api.HSClientProtocol;
-import org.apache.hadoop.yarn.ipc.ProtoOverHadoopRpcEngine;
-import org.apache.hadoop.yarn.proto.HSClientProtocol.HSClientProtocolService;
+import org.apache.hadoop.mapreduce.v2.api.HSClientProtocolPB;
public class HSClientProtocolPBClientImpl extends MRClientProtocolPBClientImpl
implements HSClientProtocol {
@@ -33,9 +33,9 @@ public class HSClientProtocolPBClientImp
public HSClientProtocolPBClientImpl(long clientVersion,
InetSocketAddress addr, Configuration conf) throws IOException {
super();
- RPC.setProtocolEngine(conf, HSClientProtocolService.BlockingInterface.class,
- ProtoOverHadoopRpcEngine.class);
- proxy = (HSClientProtocolService.BlockingInterface)RPC.getProxy(
- HSClientProtocolService.BlockingInterface.class, clientVersion, addr, conf);
+ RPC.setProtocolEngine(conf, HSClientProtocolPB.class,
+ ProtobufRpcEngine.class);
+ proxy = (HSClientProtocolPB)RPC.getProxy(
+ HSClientProtocolPB.class, clientVersion, addr, conf);
}
}
\ No newline at end of file
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/MRClientProtocolPBClientImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/MRClientProtocolPBClientImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/MRClientProtocolPBClientImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/client/MRClientProtocolPBClientImpl.java Thu Mar 29 02:02:17 2012
@@ -23,8 +23,10 @@ import java.lang.reflect.UndeclaredThrow
import java.net.InetSocketAddress;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.ipc.ProtobufRpcEngine;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.mapreduce.v2.api.MRClientProtocol;
+import org.apache.hadoop.mapreduce.v2.api.MRClientProtocolPB;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.FailTaskAttemptRequest;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.FailTaskAttemptResponse;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersRequest;
@@ -86,21 +88,20 @@ import org.apache.hadoop.mapreduce.v2.pr
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.KillTaskAttemptRequestProto;
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.KillTaskRequestProto;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
-import org.apache.hadoop.yarn.ipc.ProtoOverHadoopRpcEngine;
-import org.apache.hadoop.yarn.proto.MRClientProtocol.MRClientProtocolService;
+import org.apache.hadoop.yarn.exceptions.impl.pb.YarnRemoteExceptionPBImpl;
import com.google.protobuf.ServiceException;
public class MRClientProtocolPBClientImpl implements MRClientProtocol {
- protected MRClientProtocolService.BlockingInterface proxy;
+ protected MRClientProtocolPB proxy;
public MRClientProtocolPBClientImpl() {};
public MRClientProtocolPBClientImpl(long clientVersion, InetSocketAddress addr, Configuration conf) throws IOException {
- RPC.setProtocolEngine(conf, MRClientProtocolService.BlockingInterface.class, ProtoOverHadoopRpcEngine.class);
- proxy = (MRClientProtocolService.BlockingInterface)RPC.getProxy(
- MRClientProtocolService.BlockingInterface.class, clientVersion, addr, conf);
+ RPC.setProtocolEngine(conf, MRClientProtocolPB.class, ProtobufRpcEngine.class);
+ proxy = (MRClientProtocolPB)RPC.getProxy(
+ MRClientProtocolPB.class, clientVersion, addr, conf);
}
@Override
@@ -110,13 +111,7 @@ public class MRClientProtocolPBClientImp
try {
return new GetJobReportResponsePBImpl(proxy.getJobReport(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -127,13 +122,7 @@ public class MRClientProtocolPBClientImp
try {
return new GetTaskReportResponsePBImpl(proxy.getTaskReport(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -144,13 +133,7 @@ public class MRClientProtocolPBClientImp
try {
return new GetTaskAttemptReportResponsePBImpl(proxy.getTaskAttemptReport(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -161,13 +144,7 @@ public class MRClientProtocolPBClientImp
try {
return new GetCountersResponsePBImpl(proxy.getCounters(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -178,13 +155,7 @@ public class MRClientProtocolPBClientImp
try {
return new GetTaskAttemptCompletionEventsResponsePBImpl(proxy.getTaskAttemptCompletionEvents(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -195,13 +166,7 @@ public class MRClientProtocolPBClientImp
try {
return new GetTaskReportsResponsePBImpl(proxy.getTaskReports(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -212,13 +177,7 @@ public class MRClientProtocolPBClientImp
try {
return new GetDiagnosticsResponsePBImpl(proxy.getDiagnostics(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -231,13 +190,7 @@ public class MRClientProtocolPBClientImp
return new GetDelegationTokenResponsePBImpl(proxy.getDelegationToken(
null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -248,13 +201,7 @@ public class MRClientProtocolPBClientImp
try {
return new KillJobResponsePBImpl(proxy.killJob(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -265,13 +212,7 @@ public class MRClientProtocolPBClientImp
try {
return new KillTaskResponsePBImpl(proxy.killTask(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -282,13 +223,7 @@ public class MRClientProtocolPBClientImp
try {
return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -299,13 +234,7 @@ public class MRClientProtocolPBClientImp
try {
return new FailTaskAttemptResponsePBImpl(proxy.failTaskAttempt(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/HSClientProtocolPBServiceImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/HSClientProtocolPBServiceImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/HSClientProtocolPBServiceImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/HSClientProtocolPBServiceImpl.java Thu Mar 29 02:02:17 2012
@@ -19,10 +19,10 @@
package org.apache.hadoop.mapreduce.v2.api.impl.pb.service;
import org.apache.hadoop.mapreduce.v2.api.HSClientProtocol;
-import org.apache.hadoop.yarn.proto.HSClientProtocol.HSClientProtocolService.BlockingInterface;
+import org.apache.hadoop.mapreduce.v2.api.HSClientProtocolPB;
public class HSClientProtocolPBServiceImpl extends MRClientProtocolPBServiceImpl
- implements BlockingInterface {
+ implements HSClientProtocolPB {
public HSClientProtocolPBServiceImpl(HSClientProtocol impl) {
super(impl);
}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/MRClientProtocolPBServiceImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/MRClientProtocolPBServiceImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/MRClientProtocolPBServiceImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/impl/pb/service/MRClientProtocolPBServiceImpl.java Thu Mar 29 02:02:17 2012
@@ -19,6 +19,7 @@
package org.apache.hadoop.mapreduce.v2.api.impl.pb.service;
import org.apache.hadoop.mapreduce.v2.api.MRClientProtocol;
+import org.apache.hadoop.mapreduce.v2.api.MRClientProtocolPB;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.FailTaskAttemptRequest;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.FailTaskAttemptResponse;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersRequest;
@@ -91,12 +92,11 @@ import org.apache.hadoop.mapreduce.v2.pr
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.KillTaskRequestProto;
import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.KillTaskResponseProto;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
-import org.apache.hadoop.yarn.proto.MRClientProtocol.MRClientProtocolService.BlockingInterface;
import com.google.protobuf.RpcController;
import com.google.protobuf.ServiceException;
-public class MRClientProtocolPBServiceImpl implements BlockingInterface {
+public class MRClientProtocolPBServiceImpl implements MRClientProtocolPB {
private MRClientProtocol real;
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/client/ClientHSSecurityInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/client/ClientHSSecurityInfo.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/client/ClientHSSecurityInfo.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/client/ClientHSSecurityInfo.java Thu Mar 29 02:02:17 2012
@@ -21,20 +21,20 @@ package org.apache.hadoop.mapreduce.v2.s
import java.lang.annotation.Annotation;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapreduce.v2.api.HSClientProtocolPB;
import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig;
import org.apache.hadoop.security.KerberosInfo;
import org.apache.hadoop.security.SecurityInfo;
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.hadoop.security.token.TokenInfo;
import org.apache.hadoop.security.token.TokenSelector;
-import org.apache.hadoop.yarn.proto.HSClientProtocol;
public class ClientHSSecurityInfo extends SecurityInfo {
@Override
public KerberosInfo getKerberosInfo(Class<?> protocol, Configuration conf) {
if (!protocol
- .equals(HSClientProtocol.HSClientProtocolService.BlockingInterface.class)) {
+ .equals(HSClientProtocolPB.class)) {
return null;
}
return new KerberosInfo() {
@@ -59,7 +59,7 @@ public class ClientHSSecurityInfo extend
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol
- .equals(HSClientProtocol.HSClientProtocolService.BlockingInterface.class)) {
+ .equals(HSClientProtocolPB.class)) {
return null;
}
return new TokenInfo() {
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/yarn/proto/HSClientProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/yarn/proto/HSClientProtocol.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/yarn/proto/HSClientProtocol.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/yarn/proto/HSClientProtocol.java Thu Mar 29 02:02:17 2012
@@ -18,14 +18,23 @@
package org.apache.hadoop.yarn.proto;
+import org.apache.hadoop.mapreduce.v2.api.MRClientProtocolPB;
+import org.apache.hadoop.yarn.proto.MRClientProtocol.MRClientProtocolService;
+
/**
* Fake protocol to differentiate the blocking interfaces in the
* security info class loaders.
*/
public interface HSClientProtocol {
public abstract class HSClientProtocolService {
- public interface BlockingInterface extends
- MRClientProtocol.MRClientProtocolService.BlockingInterface {
+ public interface BlockingInterface extends MRClientProtocolPB {
+ }
+
+ public static com.google.protobuf.BlockingService newReflectiveBlockingService(
+ final HSClientProtocolService.BlockingInterface impl) {
+ // The cast is safe
+ return MRClientProtocolService
+ .newReflectiveBlockingService((MRClientProtocolService.BlockingInterface) impl);
}
}
}
\ No newline at end of file
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java Thu Mar 29 02:02:17 2012
@@ -36,6 +36,7 @@ import org.apache.hadoop.io.Text;
import org.apache.hadoop.ipc.Server;
import org.apache.hadoop.mapreduce.JobACL;
import org.apache.hadoop.mapreduce.TypeConverter;
+import org.apache.hadoop.mapreduce.v2.api.HSClientProtocol;
import org.apache.hadoop.mapreduce.v2.api.MRClientProtocol;
import org.apache.hadoop.mapreduce.v2.api.MRDelegationTokenIdentifier;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.FailTaskAttemptRequest;
@@ -96,7 +97,7 @@ public class HistoryClientService extend
private static final Log LOG = LogFactory.getLog(HistoryClientService.class);
- private MRClientProtocol protocolHandler;
+ private HSClientProtocol protocolHandler;
private Server server;
private WebApp webApp;
private InetSocketAddress bindAddress;
@@ -107,7 +108,7 @@ public class HistoryClientService extend
JHSDelegationTokenSecretManager jhsDTSecretManager) {
super("HistoryClientService");
this.history = history;
- this.protocolHandler = new MRClientProtocolHandler();
+ this.protocolHandler = new HSClientProtocolHandler();
this.jhsDTSecretManager = jhsDTSecretManager;
}
@@ -128,7 +129,7 @@ public class HistoryClientService extend
}
server =
- rpc.getServer(MRClientProtocol.class, protocolHandler, address,
+ rpc.getServer(HSClientProtocol.class, protocolHandler, address,
conf, jhsDTSecretManager,
conf.getInt(JHAdminConfig.MR_HISTORY_CLIENT_THREAD_COUNT,
JHAdminConfig.DEFAULT_MR_HISTORY_CLIENT_THREAD_COUNT));
@@ -177,7 +178,7 @@ public class HistoryClientService extend
return this.bindAddress;
}
- private class MRClientProtocolHandler implements MRClientProtocol {
+ private class HSClientProtocolHandler implements HSClientProtocol {
private RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java Thu Mar 29 02:02:17 2012
@@ -34,6 +34,7 @@ import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.MRConfig;
import org.apache.hadoop.mapreduce.TaskAttemptID;
import org.apache.hadoop.mapreduce.TaskType;
+import org.apache.hadoop.mapreduce.v2.api.HSClientProtocol;
import org.apache.hadoop.mapreduce.v2.api.MRClientProtocol;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.FailTaskAttemptRequest;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.FailTaskAttemptResponse;
@@ -340,9 +341,10 @@ public class TestClientRedirect {
}
}
- class HistoryService extends AMService {
+ class HistoryService extends AMService implements HSClientProtocol {
public HistoryService() {
super(HSHOSTADDRESS);
+ this.protocol = HSClientProtocol.class;
}
@Override
@@ -357,6 +359,7 @@ public class TestClientRedirect {
class AMService extends AbstractService
implements MRClientProtocol {
+ protected Class<?> protocol;
private InetSocketAddress bindAddress;
private Server server;
private final String hostAddress;
@@ -367,6 +370,7 @@ public class TestClientRedirect {
public AMService(String hostAddress) {
super("AMService");
+ this.protocol = MRClientProtocol.class;
this.hostAddress = hostAddress;
}
@@ -383,7 +387,7 @@ public class TestClientRedirect {
}
server =
- rpc.getServer(MRClientProtocol.class, this, address,
+ rpc.getServer(protocol, this, address,
conf, null, 1);
server.start();
this.bindAddress =
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java Thu Mar 29 02:02:17 2012
@@ -35,7 +35,7 @@ import org.apache.hadoop.fs.permission.F
import org.apache.hadoop.mapreduce.Counters;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.TypeConverter;
-import org.apache.hadoop.mapreduce.v2.api.MRClientProtocol;
+import org.apache.hadoop.mapreduce.v2.api.HSClientProtocol;
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetJobReportRequest;
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo;
import org.apache.hadoop.mapreduce.v2.api.records.JobId;
@@ -142,7 +142,7 @@ public class TestMRJobsWithHistoryServic
LOG.info("CounterMR " + counterMR);
Assert.assertEquals(counterHS, counterMR);
- MRClientProtocol historyClient = instantiateHistoryProxy();
+ HSClientProtocol historyClient = instantiateHistoryProxy();
GetJobReportRequest gjReq = Records.newRecord(GetJobReportRequest.class);
gjReq.setJobId(jobId);
JobReport jobReport = historyClient.getJobReport(gjReq).getJobReport();
@@ -164,12 +164,12 @@ public class TestMRJobsWithHistoryServic
&& jobReport.getFinishTime() >= jobReport.getStartTime());
}
- private MRClientProtocol instantiateHistoryProxy() {
+ private HSClientProtocol instantiateHistoryProxy() {
final String serviceAddr =
mrCluster.getConfig().get(JHAdminConfig.MR_HISTORY_ADDRESS);
final YarnRPC rpc = YarnRPC.create(conf);
- MRClientProtocol historyClient =
- (MRClientProtocol) rpc.getProxy(MRClientProtocol.class,
+ HSClientProtocol historyClient =
+ (HSClientProtocol) rpc.getProxy(HSClientProtocol.class,
NetUtils.createSocketAddr(serviceAddr), mrCluster.getConfig());
return historyClient;
}
Added: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocolPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocolPB.java?rev=1306689&view=auto
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocolPB.java (added)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocolPB.java Thu Mar 29 02:02:17 2012
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.api;
+
+import org.apache.hadoop.ipc.ProtocolInfo;
+import org.apache.hadoop.yarn.proto.AMRMProtocol.AMRMProtocolService;
+
+@ProtocolInfo(protocolName = "org.apache.hadoop.yarn.api.AMRMProtocolPB",
+ protocolVersion = 1)
+public interface AMRMProtocolPB extends AMRMProtocolService.BlockingInterface {
+
+}
Added: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocolPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocolPB.java?rev=1306689&view=auto
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocolPB.java (added)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocolPB.java Thu Mar 29 02:02:17 2012
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.api;
+
+import org.apache.hadoop.ipc.ProtocolInfo;
+import org.apache.hadoop.yarn.proto.ClientRMProtocol.ClientRMProtocolService;
+
+@ProtocolInfo(protocolName = "org.apache.hadoop.yarn.api.ClientRMProtocolPB",
+ protocolVersion = 1)
+public interface ClientRMProtocolPB extends ClientRMProtocolService.BlockingInterface {
+
+}
Added: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManagerPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManagerPB.java?rev=1306689&view=auto
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManagerPB.java (added)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManagerPB.java Thu Mar 29 02:02:17 2012
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.yarn.api;
+
+import org.apache.hadoop.ipc.ProtocolInfo;
+import org.apache.hadoop.yarn.proto.ContainerManager.ContainerManagerService;
+
+@ProtocolInfo(
+ protocolName = "org.apache.hadoop.yarn.api.ContainerManagerPB",
+ protocolVersion = 1)
+public interface ContainerManagerPB extends ContainerManagerService.BlockingInterface {
+
+}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/impl/pb/YarnRemoteExceptionPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/impl/pb/YarnRemoteExceptionPBImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/impl/pb/YarnRemoteExceptionPBImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/impl/pb/YarnRemoteExceptionPBImpl.java Thu Mar 29 02:02:17 2012
@@ -18,12 +18,16 @@
package org.apache.hadoop.yarn.exceptions.impl.pb;
+import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.lang.reflect.UndeclaredThrowableException;
+import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
import org.apache.hadoop.yarn.proto.YarnProtos.YarnRemoteExceptionProto;
import org.apache.hadoop.yarn.proto.YarnProtos.YarnRemoteExceptionProtoOrBuilder;
+import com.google.protobuf.ServiceException;
public class YarnRemoteExceptionPBImpl extends YarnRemoteException {
@@ -105,4 +109,30 @@ public class YarnRemoteExceptionPBImpl e
}
viaProto = false;
}
+
+ /**
+ * Utility method that unwraps and throws appropriate exception.
+ * @param se ServiceException
+ * @throws YarnRemoteException
+ * @throws UndeclaredThrowableException
+ */
+ public static YarnRemoteException unwrapAndThrowException(ServiceException se)
+ throws UndeclaredThrowableException {
+ if (se.getCause() instanceof RemoteException) {
+ try {
+ throw ((RemoteException) se.getCause())
+ .unwrapRemoteException(YarnRemoteExceptionPBImpl.class);
+ } catch (YarnRemoteException ex) {
+ return ex;
+ } catch (IOException e1) {
+ throw new UndeclaredThrowableException(e1);
+ }
+ } else if (se.getCause() instanceof YarnRemoteException) {
+ return (YarnRemoteException)se.getCause();
+ } else if (se.getCause() instanceof UndeclaredThrowableException) {
+ throw (UndeclaredThrowableException)se.getCause();
+ } else {
+ throw new UndeclaredThrowableException(se);
+ }
+ }
}
\ No newline at end of file
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/AMRMProtocolPBClientImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/AMRMProtocolPBClientImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/AMRMProtocolPBClientImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/AMRMProtocolPBClientImpl.java Thu Mar 29 02:02:17 2012
@@ -19,12 +19,13 @@
package org.apache.hadoop.yarn.api.impl.pb.client;
import java.io.IOException;
-import java.lang.reflect.UndeclaredThrowableException;
import java.net.InetSocketAddress;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.ipc.ProtobufRpcEngine;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.yarn.api.AMRMProtocol;
+import org.apache.hadoop.yarn.api.AMRMProtocolPB;
import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest;
import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse;
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest;
@@ -38,8 +39,7 @@ import org.apache.hadoop.yarn.api.protoc
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RegisterApplicationMasterRequestPBImpl;
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RegisterApplicationMasterResponsePBImpl;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
-import org.apache.hadoop.yarn.ipc.ProtoOverHadoopRpcEngine;
-import org.apache.hadoop.yarn.proto.AMRMProtocol.AMRMProtocolService;
+import org.apache.hadoop.yarn.exceptions.impl.pb.YarnRemoteExceptionPBImpl;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationMasterRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterRequestProto;
@@ -48,12 +48,12 @@ import com.google.protobuf.ServiceExcept
public class AMRMProtocolPBClientImpl implements AMRMProtocol {
- private AMRMProtocolService.BlockingInterface proxy;
+ private AMRMProtocolPB proxy;
public AMRMProtocolPBClientImpl(long clientVersion, InetSocketAddress addr, Configuration conf) throws IOException {
- RPC.setProtocolEngine(conf, AMRMProtocolService.BlockingInterface.class, ProtoOverHadoopRpcEngine.class);
- proxy = (AMRMProtocolService.BlockingInterface)RPC.getProxy(
- AMRMProtocolService.BlockingInterface.class, clientVersion, addr, conf);
+ RPC.setProtocolEngine(conf, AMRMProtocolPB.class, ProtobufRpcEngine.class);
+ proxy = (AMRMProtocolPB)RPC.getProxy(
+ AMRMProtocolPB.class, clientVersion, addr, conf);
}
@@ -64,13 +64,7 @@ public class AMRMProtocolPBClientImpl im
try {
return new AllocateResponsePBImpl(proxy.allocate(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -83,13 +77,7 @@ public class AMRMProtocolPBClientImpl im
try {
return new FinishApplicationMasterResponsePBImpl(proxy.finishApplicationMaster(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -100,13 +88,7 @@ public class AMRMProtocolPBClientImpl im
try {
return new RegisterApplicationMasterResponsePBImpl(proxy.registerApplicationMaster(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java Thu Mar 29 02:02:17 2012
@@ -19,12 +19,13 @@
package org.apache.hadoop.yarn.api.impl.pb.client;
import java.io.IOException;
-import java.lang.reflect.UndeclaredThrowableException;
import java.net.InetSocketAddress;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.ipc.ProtobufRpcEngine;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
+import org.apache.hadoop.yarn.api.ClientRMProtocolPB;
import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest;
import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest;
@@ -66,8 +67,7 @@ import org.apache.hadoop.yarn.api.protoc
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.SubmitApplicationRequestPBImpl;
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.SubmitApplicationResponsePBImpl;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
-import org.apache.hadoop.yarn.ipc.ProtoOverHadoopRpcEngine;
-import org.apache.hadoop.yarn.proto.ClientRMProtocol.ClientRMProtocolService;
+import org.apache.hadoop.yarn.exceptions.impl.pb.YarnRemoteExceptionPBImpl;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterMetricsRequestProto;
@@ -83,12 +83,12 @@ import com.google.protobuf.ServiceExcept
public class ClientRMProtocolPBClientImpl implements ClientRMProtocol {
- private ClientRMProtocolService.BlockingInterface proxy;
+ private ClientRMProtocolPB proxy;
public ClientRMProtocolPBClientImpl(long clientVersion, InetSocketAddress addr, Configuration conf) throws IOException {
- RPC.setProtocolEngine(conf, ClientRMProtocolService.BlockingInterface.class, ProtoOverHadoopRpcEngine.class);
- proxy = (ClientRMProtocolService.BlockingInterface)RPC.getProxy(
- ClientRMProtocolService.BlockingInterface.class, clientVersion, addr, conf);
+ RPC.setProtocolEngine(conf, ClientRMProtocolPB.class, ProtobufRpcEngine.class);
+ proxy = (ClientRMProtocolPB)RPC.getProxy(
+ ClientRMProtocolPB.class, clientVersion, addr, conf);
}
@Override
@@ -98,13 +98,7 @@ public class ClientRMProtocolPBClientImp
try {
return new KillApplicationResponsePBImpl(proxy.forceKillApplication(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -115,13 +109,7 @@ public class ClientRMProtocolPBClientImp
try {
return new GetApplicationReportResponsePBImpl(proxy.getApplicationReport(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -132,13 +120,7 @@ public class ClientRMProtocolPBClientImp
try {
return new GetClusterMetricsResponsePBImpl(proxy.getClusterMetrics(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -149,13 +131,7 @@ public class ClientRMProtocolPBClientImp
try {
return new GetNewApplicationResponsePBImpl(proxy.getNewApplication(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -166,13 +142,7 @@ public class ClientRMProtocolPBClientImp
try {
return new SubmitApplicationResponsePBImpl(proxy.submitApplication(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -185,13 +155,7 @@ public class ClientRMProtocolPBClientImp
return new GetAllApplicationsResponsePBImpl(
proxy.getAllApplications(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -204,13 +168,7 @@ public class ClientRMProtocolPBClientImp
return new GetClusterNodesResponsePBImpl(
proxy.getClusterNodes(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -223,13 +181,7 @@ public class ClientRMProtocolPBClientImp
return new GetQueueInfoResponsePBImpl(
proxy.getQueueInfo(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -242,13 +194,7 @@ public class ClientRMProtocolPBClientImp
return new GetQueueUserAclsInfoResponsePBImpl(
proxy.getQueueUserAcls(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -261,13 +207,7 @@ public class ClientRMProtocolPBClientImp
return new GetDelegationTokenResponsePBImpl(
proxy.getDelegationToken(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ContainerManagerPBClientImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ContainerManagerPBClientImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ContainerManagerPBClientImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ContainerManagerPBClientImpl.java Thu Mar 29 02:02:17 2012
@@ -19,12 +19,13 @@
package org.apache.hadoop.yarn.api.impl.pb.client;
import java.io.IOException;
-import java.lang.reflect.UndeclaredThrowableException;
import java.net.InetSocketAddress;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.ipc.ProtobufRpcEngine;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.yarn.api.ContainerManager;
+import org.apache.hadoop.yarn.api.ContainerManagerPB;
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusRequest;
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusResponse;
import org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest;
@@ -38,8 +39,7 @@ import org.apache.hadoop.yarn.api.protoc
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.StopContainerRequestPBImpl;
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.StopContainerResponsePBImpl;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
-import org.apache.hadoop.yarn.ipc.ProtoOverHadoopRpcEngine;
-import org.apache.hadoop.yarn.proto.ContainerManager.ContainerManagerService;
+import org.apache.hadoop.yarn.exceptions.impl.pb.YarnRemoteExceptionPBImpl;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.StartContainerRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.StopContainerRequestProto;
@@ -48,12 +48,12 @@ import com.google.protobuf.ServiceExcept
public class ContainerManagerPBClientImpl implements ContainerManager {
- private ContainerManagerService.BlockingInterface proxy;
+ private ContainerManagerPB proxy;
public ContainerManagerPBClientImpl(long clientVersion, InetSocketAddress addr, Configuration conf) throws IOException {
- RPC.setProtocolEngine(conf, ContainerManagerService.BlockingInterface.class, ProtoOverHadoopRpcEngine.class);
- proxy = (ContainerManagerService.BlockingInterface)RPC.getProxy(
- ContainerManagerService.BlockingInterface.class, clientVersion, addr, conf);
+ RPC.setProtocolEngine(conf, ContainerManagerPB.class, ProtobufRpcEngine.class);
+ proxy = (ContainerManagerPB)RPC.getProxy(
+ ContainerManagerPB.class, clientVersion, addr, conf);
}
public void close() {
@@ -69,13 +69,7 @@ public class ContainerManagerPBClientImp
try {
return new GetContainerStatusResponsePBImpl(proxy.getContainerStatus(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@@ -86,31 +80,20 @@ public class ContainerManagerPBClientImp
try {
return new StartContainerResponsePBImpl(proxy.startContainer(null, requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
@Override
public StopContainerResponse stopContainer(StopContainerRequest request)
throws YarnRemoteException {
- StopContainerRequestProto requestProto = ((StopContainerRequestPBImpl)request).getProto();
+ StopContainerRequestProto requestProto = ((StopContainerRequestPBImpl) request)
+ .getProto();
try {
- return new StopContainerResponsePBImpl(proxy.stopContainer(null, requestProto));
+ return new StopContainerResponsePBImpl(proxy.stopContainer(null,
+ requestProto));
} catch (ServiceException e) {
- if (e.getCause() instanceof YarnRemoteException) {
- throw (YarnRemoteException)e.getCause();
- } else if (e.getCause() instanceof UndeclaredThrowableException) {
- throw (UndeclaredThrowableException)e.getCause();
- } else {
- throw new UndeclaredThrowableException(e);
- }
+ throw YarnRemoteExceptionPBImpl.unwrapAndThrowException(e);
}
}
-
}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/AMRMProtocolPBServiceImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/AMRMProtocolPBServiceImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/AMRMProtocolPBServiceImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/AMRMProtocolPBServiceImpl.java Thu Mar 29 02:02:17 2012
@@ -19,6 +19,7 @@
package org.apache.hadoop.yarn.api.impl.pb.service;
import org.apache.hadoop.yarn.api.AMRMProtocol;
+import org.apache.hadoop.yarn.api.AMRMProtocolPB;
import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse;
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse;
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
@@ -29,7 +30,6 @@ import org.apache.hadoop.yarn.api.protoc
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RegisterApplicationMasterRequestPBImpl;
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RegisterApplicationMasterResponsePBImpl;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
-import org.apache.hadoop.yarn.proto.AMRMProtocol.AMRMProtocolService.BlockingInterface;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationMasterRequestProto;
@@ -40,7 +40,7 @@ import org.apache.hadoop.yarn.proto.Yarn
import com.google.protobuf.RpcController;
import com.google.protobuf.ServiceException;
-public class AMRMProtocolPBServiceImpl implements BlockingInterface {
+public class AMRMProtocolPBServiceImpl implements AMRMProtocolPB {
private AMRMProtocol real;
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java Thu Mar 29 02:02:17 2012
@@ -19,6 +19,7 @@
package org.apache.hadoop.yarn.api.impl.pb.service;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
+import org.apache.hadoop.yarn.api.ClientRMProtocolPB;
import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportResponse;
import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsResponse;
@@ -50,7 +51,6 @@ import org.apache.hadoop.yarn.api.protoc
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.SubmitApplicationRequestPBImpl;
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.SubmitApplicationResponsePBImpl;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
-import org.apache.hadoop.yarn.proto.ClientRMProtocol.ClientRMProtocolService.BlockingInterface;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportRequestProto;
@@ -75,7 +75,7 @@ import org.apache.hadoop.yarn.proto.Yarn
import com.google.protobuf.RpcController;
import com.google.protobuf.ServiceException;
-public class ClientRMProtocolPBServiceImpl implements BlockingInterface {
+public class ClientRMProtocolPBServiceImpl implements ClientRMProtocolPB {
private ClientRMProtocol real;
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ContainerManagerPBServiceImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ContainerManagerPBServiceImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ContainerManagerPBServiceImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ContainerManagerPBServiceImpl.java Thu Mar 29 02:02:17 2012
@@ -19,6 +19,7 @@
package org.apache.hadoop.yarn.api.impl.pb.service;
import org.apache.hadoop.yarn.api.ContainerManager;
+import org.apache.hadoop.yarn.api.ContainerManagerPB;
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusResponse;
import org.apache.hadoop.yarn.api.protocolrecords.StartContainerResponse;
import org.apache.hadoop.yarn.api.protocolrecords.StopContainerResponse;
@@ -29,7 +30,6 @@ import org.apache.hadoop.yarn.api.protoc
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.StopContainerRequestPBImpl;
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.StopContainerResponsePBImpl;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
-import org.apache.hadoop.yarn.proto.ContainerManager.ContainerManagerService.BlockingInterface;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.StartContainerRequestProto;
@@ -40,7 +40,7 @@ import org.apache.hadoop.yarn.proto.Yarn
import com.google.protobuf.RpcController;
import com.google.protobuf.ServiceException;
-public class ContainerManagerPBServiceImpl implements BlockingInterface {
+public class ContainerManagerPBServiceImpl implements ContainerManagerPB {
private ContainerManager real;
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/factories/impl/pb/RpcServerFactoryPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/factories/impl/pb/RpcServerFactoryPBImpl.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/factories/impl/pb/RpcServerFactoryPBImpl.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/factories/impl/pb/RpcServerFactoryPBImpl.java Thu Mar 29 02:02:17 2012
@@ -26,19 +26,23 @@ import java.net.InetSocketAddress;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.ipc.ProtobufRpcEngine;
+import org.apache.hadoop.ipc.RpcPayloadHeader.RpcKind;
import org.apache.hadoop.ipc.Server;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.security.token.SecretManager;
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.hadoop.yarn.YarnException;
import org.apache.hadoop.yarn.factories.RpcServerFactory;
-import org.apache.hadoop.yarn.ipc.ProtoOverHadoopRpcEngine;
import com.google.protobuf.BlockingService;
public class RpcServerFactoryPBImpl implements RpcServerFactory {
+ private static final Log LOG = LogFactory.getLog(RpcServerFactoryPBImpl.class);
private static final String PROTO_GEN_PACKAGE_NAME = "org.apache.hadoop.yarn.proto";
private static final String PROTO_GEN_CLASS_SUFFIX = "Service";
private static final String PB_IMPL_PACKAGE_SUFFIX = "impl.pb.service";
@@ -96,6 +100,7 @@ public class RpcServerFactoryPBImpl impl
throw new YarnException(e);
}
+ Class<?> pbProtocol = service.getClass().getInterfaces()[0];
Method method = protoCache.get(protocol);
if (method == null) {
Class<?> protoClazz = null;
@@ -106,7 +111,8 @@ public class RpcServerFactoryPBImpl impl
+ getProtoClassName(protocol) + "]", e);
}
try {
- method = protoClazz.getMethod("newReflectiveBlockingService", service.getClass().getInterfaces()[0]);
+ method = protoClazz.getMethod("newReflectiveBlockingService",
+ pbProtocol.getInterfaces()[0]);
method.setAccessible(true);
protoCache.putIfAbsent(protocol, method);
} catch (NoSuchMethodException e) {
@@ -115,7 +121,7 @@ public class RpcServerFactoryPBImpl impl
}
try {
- return createServer(addr, conf, secretManager, numHandlers,
+ return createServer(pbProtocol, addr, conf, secretManager, numHandlers,
(BlockingService)method.invoke(null, service));
} catch (InvocationTargetException e) {
throw new YarnException(e);
@@ -148,13 +154,15 @@ public class RpcServerFactoryPBImpl impl
return clazz.getPackage().getName();
}
- private Server createServer(InetSocketAddress addr, Configuration conf,
+ private Server createServer(Class<?> pbProtocol, InetSocketAddress addr, Configuration conf,
SecretManager<? extends TokenIdentifier> secretManager, int numHandlers,
BlockingService blockingService) throws IOException {
- RPC.setProtocolEngine(conf, BlockingService.class, ProtoOverHadoopRpcEngine.class);
- Server server = RPC.getServer(BlockingService.class, blockingService,
+ RPC.setProtocolEngine(conf, pbProtocol, ProtobufRpcEngine.class);
+ RPC.Server server = RPC.getServer(pbProtocol, blockingService,
addr.getHostName(), addr.getPort(), numHandlers, false, conf,
secretManager);
+ LOG.info("Adding protocol "+pbProtocol.getCanonicalName()+" to the server");
+ server.addProtocol(RpcKind.RPC_PROTOCOL_BUFFER, pbProtocol, blockingService);
return server;
}
}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/ContainerManagerSecurityInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/ContainerManagerSecurityInfo.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/ContainerManagerSecurityInfo.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/ContainerManagerSecurityInfo.java Thu Mar 29 02:02:17 2012
@@ -26,7 +26,7 @@ import org.apache.hadoop.security.Securi
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.hadoop.security.token.TokenInfo;
import org.apache.hadoop.security.token.TokenSelector;
-import org.apache.hadoop.yarn.proto.ContainerManager;
+import org.apache.hadoop.yarn.api.ContainerManagerPB;
public class ContainerManagerSecurityInfo extends SecurityInfo {
@@ -38,7 +38,7 @@ public class ContainerManagerSecurityInf
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol
- .equals(ContainerManager.ContainerManagerService.BlockingInterface.class)) {
+ .equals(ContainerManagerPB.class)) {
return null;
}
return new TokenInfo() {
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/SchedulerSecurityInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/SchedulerSecurityInfo.java?rev=1306689&r1=1306688&r2=1306689&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/SchedulerSecurityInfo.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/security/SchedulerSecurityInfo.java Thu Mar 29 02:02:17 2012
@@ -26,7 +26,7 @@ import org.apache.hadoop.security.Securi
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.hadoop.security.token.TokenInfo;
import org.apache.hadoop.security.token.TokenSelector;
-import org.apache.hadoop.yarn.proto.AMRMProtocol;
+import org.apache.hadoop.yarn.api.AMRMProtocolPB;
public class SchedulerSecurityInfo extends SecurityInfo {
@@ -37,7 +37,7 @@ public class SchedulerSecurityInfo exten
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
- if (!protocol.equals(AMRMProtocol.AMRMProtocolService.BlockingInterface.class)) {
+ if (!protocol.equals(AMRMProtocolPB.class)) {
return null;
}
return new TokenInfo() {