You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-commits@hadoop.apache.org by sz...@apache.org on 2013/05/10 00:46:41 UTC
svn commit: r1480824 [1/2] - in
/hadoop/common/branches/HDFS-2802/hadoop-yarn-project: ./
hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/
hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java...
Author: szetszwo
Date: Thu May 9 22:46:39 2013
New Revision: 1480824
URL: http://svn.apache.org/r1480824
Log:
Merge r1480440 through r1480820 from trunk.
Modified:
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/CHANGES.txt
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-unmanaged-am-launcher/src/main/java/org/apache/hadoop/yarn/applications/unmanagedamlauncher/UnmanagedAMLauncher.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClient.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientAsync.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientImpl.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClient.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClientImpl.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/NodeCLI.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestAMRMClient.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestYarnClient.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/AMRMProtocolPBClientImpl.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/AMRMProtocolPBServiceImpl.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/TestRPCFactories.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Allocation.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSLeafQueue.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSParentQueue.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSQueue.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSSchedulerApp.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSSchedulerNode.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairSchedulerConfiguration.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/SchedulingPolicy.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/FairSharePolicy.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/FifoPolicy.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMTokens.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/TestQueueMetrics.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java
hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/AppReportFetcher.java
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/CHANGES.txt?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/CHANGES.txt Thu May 9 22:46:39 2013
@@ -10,9 +10,6 @@ Trunk - Unreleased
Azure environments. (See breakdown of tasks below for subtasks and
contributors)
- YARN-45. Add protocol for schedulers to request containers back from
- ApplicationMasters. (Carlo Curino, cdouglas)
-
IMPROVEMENTS
YARN-84. Use Builder to build RPC server. (Brandon Li via suresh)
@@ -118,11 +115,20 @@ Release 2.0.5-beta - UNRELEASED
YARN-632. Changed ContainerManager api to throw IOException and
YarnRemoteException. (Xuan Gong via vinodkv)
+ YARN-631. Changed ClientRMProtocol api to throw IOException and
+ YarnRemoteException. (Xuan Gong via vinodkv)
+
+ YARN-630. Changed AMRMProtocol api to throw IOException and
+ YarnRemoteException. (Xuan Gong via vinodkv)
+
NEW FEATURES
YARN-482. FS: Extend SchedulingMode to intermediate queues.
(kkambatl via tucu)
+ YARN-45. Add protocol for schedulers to request containers back from
+ ApplicationMasters. (Carlo Curino, cdouglas)
+
IMPROVEMENTS
YARN-365. Change NM heartbeat handling to not generate a scheduler event
@@ -229,6 +235,11 @@ Release 2.0.5-beta - UNRELEASED
tokens for app attempt so that RM can be restarted while preserving current
applications. (Jian He via vinodkv)
+ YARN-568. Add support for work preserving preemption to the FairScheduler.
+ (Carlo Curino and Sandy Ryza via cdouglas)
+
+ YARN-598. Add virtual cores to queue metrics. (sandyr via tucu)
+
OPTIMIZATIONS
BUG FIXES
@@ -353,7 +364,15 @@ Release 2.0.5-beta - UNRELEASED
YARN-646. Fix two typos in Fair Scheduler user guide. (Dapeng Sun via atm)
-Release 2.0.4-alpha - UNRELEASED
+ YARN-507. Add interface visibility and stability annotations to FS
+ interfaces/classes. (kkambatl via tucu)
+
+ YARN-637. FS: maxAssign is not honored. (kkambatl via tucu)
+
+ YARN-655. Fair scheduler metrics should subtract allocated memory from
+ available memory. (sandyr via tucu)
+
+Release 2.0.4-alpha - 2013-04-25
INCOMPATIBLE CHANGES
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java Thu May 9 22:46:39 2013
@@ -18,6 +18,8 @@
package org.apache.hadoop.yarn.api;
+import java.io.IOException;
+
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest;
@@ -57,10 +59,11 @@ public interface AMRMProtocol {
* @param request registration request
* @return registration respose
* @throws YarnRemoteException
+ * @throws IOException
*/
public RegisterApplicationMasterResponse registerApplicationMaster(
RegisterApplicationMasterRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by an <code>ApplicationMaster</code> to notify the
@@ -76,10 +79,11 @@ public interface AMRMProtocol {
* @param request completion request
* @return completion response
* @throws YarnRemoteException
+ * @throws IOException
*/
public FinishApplicationMasterResponse finishApplicationMaster(
FinishApplicationMasterRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The main interface between an <code>ApplicationMaster</code>
@@ -105,7 +109,8 @@ public interface AMRMProtocol {
* @param request allocation request
* @return allocation response
* @throws YarnRemoteException
+ * @throws IOException
*/
public AllocateResponse allocate(AllocateRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
}
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java Thu May 9 22:46:39 2013
@@ -18,6 +18,8 @@
package org.apache.hadoop.yarn.api;
+import java.io.IOException;
+
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
@@ -78,11 +80,12 @@ public interface ClientRMProtocol {
* @return response containing the new <code>ApplicationId</code> to be used
* to submit an application
* @throws YarnRemoteException
+ * @throws IOException
* @see #submitApplication(SubmitApplicationRequest)
*/
public GetNewApplicationResponse getNewApplication(
GetNewApplicationRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by clients to submit a new application to the
@@ -106,11 +109,12 @@ public interface ClientRMProtocol {
* @param request request to submit a new application
* @return (empty) response on accepting the submission
* @throws YarnRemoteException
+ * @throws IOException
* @see #getNewApplication(GetNewApplicationRequest)
*/
public SubmitApplicationResponse submitApplication(
SubmitApplicationRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by clients to request the
@@ -129,11 +133,12 @@ public interface ClientRMProtocol {
* @return <code>ResourceManager</code> returns an empty response
* on success and throws an exception on rejecting the request
* @throws YarnRemoteException
+ * @throws IOException
* @see #getQueueUserAcls(GetQueueUserAclsInfoRequest)
*/
public KillApplicationResponse forceKillApplication(
KillApplicationRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by clients to get a report of an Application from
@@ -164,10 +169,11 @@ public interface ClientRMProtocol {
* @param request request for an application report
* @return application report
* @throws YarnRemoteException
+ * @throws IOException
*/
public GetApplicationReportResponse getApplicationReport(
GetApplicationReportRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by clients to get metrics about the cluster from
@@ -181,10 +187,11 @@ public interface ClientRMProtocol {
* @param request request for cluster metrics
* @return cluster metrics
* @throws YarnRemoteException
+ * @throws IOException
*/
public GetClusterMetricsResponse getClusterMetrics(
GetClusterMetricsRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by clients to get a report of all Applications
@@ -202,10 +209,11 @@ public interface ClientRMProtocol {
* @param request request for report on all running applications
* @return report on all running applications
* @throws YarnRemoteException
+ * @throws IOException
*/
public GetAllApplicationsResponse getAllApplications(
GetAllApplicationsRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by clients to get a report of all nodes
@@ -218,10 +226,11 @@ public interface ClientRMProtocol {
* @param request request for report on all nodes
* @return report on all nodes
* @throws YarnRemoteException
+ * @throws IOException
*/
public GetClusterNodesResponse getClusterNodes(
GetClusterNodesRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by clients to get information about <em>queues</em>
@@ -236,10 +245,11 @@ public interface ClientRMProtocol {
* @param request request to get queue information
* @return queue information
* @throws YarnRemoteException
+ * @throws IOException
*/
public GetQueueInfoResponse getQueueInfo(
GetQueueInfoRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by clients to get information about <em>queue
@@ -252,10 +262,11 @@ public interface ClientRMProtocol {
* @param request request to get queue acls for <em>current user</em>
* @return queue acls for <em>current user</em>
* @throws YarnRemoteException
+ * @throws IOException
*/
public GetQueueUserAclsInfoResponse getQueueUserAcls(
GetQueueUserAclsInfoRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>The interface used by clients to get delegation token, enabling the
@@ -267,10 +278,11 @@ public interface ClientRMProtocol {
* @param request request to get a delegation token for the client.
* @return delegation token that can be used to talk to this service
* @throws YarnRemoteException
+ * @throws IOException
*/
public GetDelegationTokenResponse getDelegationToken(
GetDelegationTokenRequest request)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* Renew an existing delegation token.
@@ -278,10 +290,12 @@ public interface ClientRMProtocol {
* @param request the delegation token to be renewed.
* @return the new expiry time for the delegation token.
* @throws YarnRemoteException
+ * @throws IOException
*/
@Private
public RenewDelegationTokenResponse renewDelegationToken(
- RenewDelegationTokenRequest request) throws YarnRemoteException;
+ RenewDelegationTokenRequest request) throws YarnRemoteException,
+ IOException;
/**
* Cancel an existing delegation token.
@@ -289,8 +303,10 @@ public interface ClientRMProtocol {
* @param request the delegation token to be cancelled.
* @return an empty response.
* @throws YarnRemoteException
+ * @throws IOException
*/
@Private
public CancelDelegationTokenResponse cancelDelegationToken(
- CancelDelegationTokenRequest request) throws YarnRemoteException;
+ CancelDelegationTokenRequest request) throws YarnRemoteException,
+ IOException;
}
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java Thu May 9 22:46:39 2013
@@ -433,8 +433,9 @@ public class ApplicationMaster {
* Main run function for the application master
*
* @throws YarnRemoteException
+ * @throws IOException
*/
- public boolean run() throws YarnRemoteException {
+ public boolean run() throws YarnRemoteException, IOException {
LOG.info("Starting ApplicationMaster");
AMRMClientAsync.CallbackHandler allocListener = new RMCallbackHandler();
@@ -533,6 +534,8 @@ public class ApplicationMaster {
resourceManager.unregisterApplicationMaster(appStatus, appMessage, null);
} catch (YarnRemoteException ex) {
LOG.error("Failed to unregister application", ex);
+ } catch (IOException e) {
+ LOG.error("Failed to unregister application", e);
}
done = true;
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java Thu May 9 22:46:39 2013
@@ -592,8 +592,10 @@ public class Client extends YarnClientIm
* @param appId Application Id of application to be monitored
* @return true if application completed successfully
* @throws YarnRemoteException
+ * @throws IOException
*/
- private boolean monitorApplication(ApplicationId appId) throws YarnRemoteException {
+ private boolean monitorApplication(ApplicationId appId)
+ throws YarnRemoteException, IOException {
while (true) {
@@ -655,8 +657,10 @@ public class Client extends YarnClientIm
* Kill a submitted application by sending a call to the ASM
* @param appId Application Id to be killed.
* @throws YarnRemoteException
+ * @throws IOException
*/
- private void forceKillApplication(ApplicationId appId) throws YarnRemoteException {
+ private void forceKillApplication(ApplicationId appId)
+ throws YarnRemoteException, IOException {
// TODO clarify whether multiple jobs with the same app id can be submitted and be running at
// the same time.
// If yes, can we kill a particular attempt only?
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-unmanaged-am-launcher/src/main/java/org/apache/hadoop/yarn/applications/unmanagedamlauncher/UnmanagedAMLauncher.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-unmanaged-am-launcher/src/main/java/org/apache/hadoop/yarn/applications/unmanagedamlauncher/UnmanagedAMLauncher.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-unmanaged-am-launcher/src/main/java/org/apache/hadoop/yarn/applications/unmanagedamlauncher/UnmanagedAMLauncher.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-unmanaged-am-launcher/src/main/java/org/apache/hadoop/yarn/applications/unmanagedamlauncher/UnmanagedAMLauncher.java Thu May 9 22:46:39 2013
@@ -357,9 +357,11 @@ public class UnmanagedAMLauncher {
* Application Id of application to be monitored
* @return true if application completed successfully
* @throws YarnRemoteException
+ * @throws IOException
*/
private ApplicationReport monitorApplication(ApplicationId appId,
- Set<YarnApplicationState> finalState) throws YarnRemoteException {
+ Set<YarnApplicationState> finalState) throws YarnRemoteException,
+ IOException {
long foundAMCompletedTime = 0;
final int timeToWaitMS = 10000;
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClient.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClient.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClient.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClient.java Thu May 9 22:46:39 2013
@@ -19,6 +19,8 @@
package org.apache.hadoop.yarn.client;
+import java.io.IOException;
+
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
@@ -72,12 +74,13 @@ public interface AMRMClient extends Serv
* @param appTrackingUrl URL at which the master info can be seen
* @return <code>RegisterApplicationMasterResponse</code>
* @throws YarnRemoteException
+ * @throws IOException
*/
public RegisterApplicationMasterResponse
registerApplicationMaster(String appHostName,
int appHostPort,
String appTrackingUrl)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* Request additional containers and receive new container allocations.
@@ -92,9 +95,10 @@ public interface AMRMClient extends Serv
* @param progressIndicator Indicates progress made by the master
* @return the response of the allocate request
* @throws YarnRemoteException
+ * @throws IOException
*/
public AllocateResponse allocate(float progressIndicator)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* Unregister the application master. This must be called in the end.
@@ -102,11 +106,12 @@ public interface AMRMClient extends Serv
* @param appMessage Diagnostics message on failure
* @param appTrackingUrl New URL to get master info
* @throws YarnRemoteException
+ * @throws IOException
*/
public void unregisterApplicationMaster(FinalApplicationStatus appStatus,
String appMessage,
String appTrackingUrl)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* Request containers for resources before calling <code>allocate</code>
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientAsync.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientAsync.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientAsync.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientAsync.java Thu May 9 22:46:39 2013
@@ -18,6 +18,7 @@
package org.apache.hadoop.yarn.client;
+import java.io.IOException;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
@@ -173,10 +174,12 @@ public class AMRMClientAsync extends Abs
/**
* Registers this application master with the resource manager. On successful
* registration, starts the heartbeating thread.
+ * @throws YarnRemoteException
+ * @throws IOException
*/
public RegisterApplicationMasterResponse registerApplicationMaster(
String appHostName, int appHostPort, String appTrackingUrl)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
RegisterApplicationMasterResponse response =
client.registerApplicationMaster(appHostName, appHostPort, appTrackingUrl);
heartbeatThread.start();
@@ -189,9 +192,10 @@ public class AMRMClientAsync extends Abs
* @param appMessage Diagnostics message on failure
* @param appTrackingUrl New URL to get master info
* @throws YarnRemoteException
+ * @throws IOException
*/
public void unregisterApplicationMaster(FinalApplicationStatus appStatus,
- String appMessage, String appTrackingUrl) throws YarnRemoteException {
+ String appMessage, String appTrackingUrl) throws YarnRemoteException, IOException {
synchronized (client) {
keepRunning = false;
client.unregisterApplicationMaster(appStatus, appMessage, appTrackingUrl);
@@ -264,6 +268,8 @@ public class AMRMClientAsync extends Abs
response = client.allocate(progress);
} catch (YarnRemoteException ex) {
LOG.error("Failed to heartbeat", ex);
+ } catch (IOException e) {
+ LOG.error("Failed to heartbeat", e);
}
}
if (response != null) {
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientImpl.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientImpl.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientImpl.java Thu May 9 22:46:39 2013
@@ -134,7 +134,7 @@ public class AMRMClientImpl extends Abst
@Override
public RegisterApplicationMasterResponse registerApplicationMaster(
String appHostName, int appHostPort, String appTrackingUrl)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
// do this only once ???
RegisterApplicationMasterRequest request = recordFactory
.newRecordInstance(RegisterApplicationMasterRequest.class);
@@ -153,7 +153,7 @@ public class AMRMClientImpl extends Abst
@Override
public AllocateResponse allocate(float progressIndicator)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
AllocateResponse allocateResponse = null;
ArrayList<ResourceRequest> askList = null;
ArrayList<ContainerId> releaseList = null;
@@ -207,7 +207,8 @@ public class AMRMClientImpl extends Abst
@Override
public void unregisterApplicationMaster(FinalApplicationStatus appStatus,
- String appMessage, String appTrackingUrl) throws YarnRemoteException {
+ String appMessage, String appTrackingUrl) throws YarnRemoteException,
+ IOException {
FinishApplicationMasterRequest request = recordFactory
.newRecordInstance(FinishApplicationMasterRequest.class);
request.setAppAttemptId(appAttemptId);
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClient.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClient.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClient.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClient.java Thu May 9 22:46:39 2013
@@ -18,6 +18,7 @@
package org.apache.hadoop.yarn.client;
+import java.io.IOException;
import java.util.List;
import org.apache.hadoop.classification.InterfaceAudience;
@@ -58,8 +59,10 @@ public interface YarnClient extends Serv
* @return response containing the new <code>ApplicationId</code> to be used
* to submit an application
* @throws YarnRemoteException
+ * @throws IOException
*/
- GetNewApplicationResponse getNewApplication() throws YarnRemoteException;
+ GetNewApplicationResponse getNewApplication() throws YarnRemoteException,
+ IOException;
/**
* <p>
@@ -73,10 +76,11 @@ public interface YarnClient extends Serv
* needed to submit a new application
* @return {@link ApplicationId} of the accepted application
* @throws YarnRemoteException
+ * @throws IOException
* @see #getNewApplication()
*/
ApplicationId submitApplication(ApplicationSubmissionContext appContext)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>
@@ -88,9 +92,11 @@ public interface YarnClient extends Serv
* @throws YarnRemoteException
* in case of errors or if YARN rejects the request due to
* access-control restrictions.
+ * @throws IOException
* @see #getQueueAclsInfo()
*/
- void killApplication(ApplicationId applicationId) throws YarnRemoteException;
+ void killApplication(ApplicationId applicationId) throws YarnRemoteException,
+ IOException;
/**
* <p>
@@ -120,9 +126,10 @@ public interface YarnClient extends Serv
* {@link ApplicationId} of the application that needs a report
* @return application report
* @throws YarnRemoteException
+ * @throws IOException
*/
ApplicationReport getApplicationReport(ApplicationId appId)
- throws YarnRemoteException;
+ throws YarnRemoteException, IOException;
/**
* <p>
@@ -137,8 +144,10 @@ public interface YarnClient extends Serv
*
* @return a list of reports of all running applications
* @throws YarnRemoteException
+ * @throws IOException
*/
- List<ApplicationReport> getApplicationList() throws YarnRemoteException;
+ List<ApplicationReport> getApplicationList() throws YarnRemoteException,
+ IOException;
/**
* <p>
@@ -147,8 +156,10 @@ public interface YarnClient extends Serv
*
* @return cluster metrics
* @throws YarnRemoteException
+ * @throws IOException
*/
- YarnClusterMetrics getYarnClusterMetrics() throws YarnRemoteException;
+ YarnClusterMetrics getYarnClusterMetrics() throws YarnRemoteException,
+ IOException;
/**
* <p>
@@ -157,8 +168,9 @@ public interface YarnClient extends Serv
*
* @return A list of report of all nodes
* @throws YarnRemoteException
+ * @throws IOException
*/
- List<NodeReport> getNodeReports() throws YarnRemoteException;
+ List<NodeReport> getNodeReports() throws YarnRemoteException, IOException;
/**
* <p>
@@ -170,8 +182,10 @@ public interface YarnClient extends Serv
* @return a delegation token ({@link DelegationToken}) that can be used to
* talk to YARN
* @throws YarnRemoteException
+ * @throws IOException
*/
- DelegationToken getRMDelegationToken(Text renewer) throws YarnRemoteException;
+ DelegationToken getRMDelegationToken(Text renewer)
+ throws YarnRemoteException, IOException;
/**
* <p>
@@ -184,8 +198,10 @@ public interface YarnClient extends Serv
* @throws YarnRemoteException
* in case of errors or if YARN rejects the request due to
* access-control restrictions.
+ * @throws IOException
*/
- QueueInfo getQueueInfo(String queueName) throws YarnRemoteException;
+ QueueInfo getQueueInfo(String queueName) throws YarnRemoteException,
+ IOException;
/**
* <p>
@@ -195,8 +211,9 @@ public interface YarnClient extends Serv
*
* @return a list of queue-information for all queues
* @throws YarnRemoteException
+ * @throws IOException
*/
- List<QueueInfo> getAllQueues() throws YarnRemoteException;
+ List<QueueInfo> getAllQueues() throws YarnRemoteException, IOException;
/**
* <p>
@@ -205,8 +222,9 @@ public interface YarnClient extends Serv
*
* @return a list of queue-information for all the top-level queues
* @throws YarnRemoteException
+ * @throws IOException
*/
- List<QueueInfo> getRootQueueInfos() throws YarnRemoteException;
+ List<QueueInfo> getRootQueueInfos() throws YarnRemoteException, IOException;
/**
* <p>
@@ -219,8 +237,10 @@ public interface YarnClient extends Serv
* @return a list of queue-information for all queues who are direct children
* of the given parent queue.
* @throws YarnRemoteException
+ * @throws IOException
*/
- List<QueueInfo> getChildQueueInfos(String parent) throws YarnRemoteException;
+ List<QueueInfo> getChildQueueInfos(String parent) throws YarnRemoteException,
+ IOException;
/**
* <p>
@@ -231,6 +251,8 @@ public interface YarnClient extends Serv
* @return a list of queue acls ({@link QueueUserACLInfo}) for
* <em>current user</em>
* @throws YarnRemoteException
+ * @throws IOException
*/
- List<QueueUserACLInfo> getQueueAclsInfo() throws YarnRemoteException;
+ List<QueueUserACLInfo> getQueueAclsInfo() throws YarnRemoteException,
+ IOException;
}
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClientImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClientImpl.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClientImpl.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/YarnClientImpl.java Thu May 9 22:46:39 2013
@@ -18,6 +18,7 @@
package org.apache.hadoop.yarn.client;
+import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;
@@ -121,7 +122,7 @@ public class YarnClientImpl extends Abst
@Override
public GetNewApplicationResponse getNewApplication()
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
GetNewApplicationRequest request =
Records.newRecord(GetNewApplicationRequest.class);
return rmClient.getNewApplication(request);
@@ -130,7 +131,7 @@ public class YarnClientImpl extends Abst
@Override
public ApplicationId
submitApplication(ApplicationSubmissionContext appContext)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
ApplicationId applicationId = appContext.getApplicationId();
appContext.setApplicationId(applicationId);
SubmitApplicationRequest request =
@@ -167,7 +168,7 @@ public class YarnClientImpl extends Abst
@Override
public void killApplication(ApplicationId applicationId)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
LOG.info("Killing application " + applicationId);
KillApplicationRequest request =
Records.newRecord(KillApplicationRequest.class);
@@ -177,7 +178,7 @@ public class YarnClientImpl extends Abst
@Override
public ApplicationReport getApplicationReport(ApplicationId appId)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
GetApplicationReportRequest request =
Records.newRecord(GetApplicationReportRequest.class);
request.setApplicationId(appId);
@@ -188,7 +189,7 @@ public class YarnClientImpl extends Abst
@Override
public List<ApplicationReport> getApplicationList()
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
GetAllApplicationsRequest request =
Records.newRecord(GetAllApplicationsRequest.class);
GetAllApplicationsResponse response = rmClient.getAllApplications(request);
@@ -196,7 +197,8 @@ public class YarnClientImpl extends Abst
}
@Override
- public YarnClusterMetrics getYarnClusterMetrics() throws YarnRemoteException {
+ public YarnClusterMetrics getYarnClusterMetrics() throws YarnRemoteException,
+ IOException {
GetClusterMetricsRequest request =
Records.newRecord(GetClusterMetricsRequest.class);
GetClusterMetricsResponse response = rmClient.getClusterMetrics(request);
@@ -204,7 +206,8 @@ public class YarnClientImpl extends Abst
}
@Override
- public List<NodeReport> getNodeReports() throws YarnRemoteException {
+ public List<NodeReport> getNodeReports() throws YarnRemoteException,
+ IOException {
GetClusterNodesRequest request =
Records.newRecord(GetClusterNodesRequest.class);
GetClusterNodesResponse response = rmClient.getClusterNodes(request);
@@ -213,7 +216,7 @@ public class YarnClientImpl extends Abst
@Override
public DelegationToken getRMDelegationToken(Text renewer)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
/* get the token from RM */
GetDelegationTokenRequest rmDTRequest =
Records.newRecord(GetDelegationTokenRequest.class);
@@ -236,7 +239,8 @@ public class YarnClientImpl extends Abst
}
@Override
- public QueueInfo getQueueInfo(String queueName) throws YarnRemoteException {
+ public QueueInfo getQueueInfo(String queueName) throws YarnRemoteException,
+ IOException {
GetQueueInfoRequest request =
getQueueInfoRequest(queueName, true, false, false);
Records.newRecord(GetQueueInfoRequest.class);
@@ -244,14 +248,16 @@ public class YarnClientImpl extends Abst
}
@Override
- public List<QueueUserACLInfo> getQueueAclsInfo() throws YarnRemoteException {
+ public List<QueueUserACLInfo> getQueueAclsInfo() throws YarnRemoteException,
+ IOException {
GetQueueUserAclsInfoRequest request =
Records.newRecord(GetQueueUserAclsInfoRequest.class);
return rmClient.getQueueUserAcls(request).getUserAclsInfoList();
}
@Override
- public List<QueueInfo> getAllQueues() throws YarnRemoteException {
+ public List<QueueInfo> getAllQueues() throws YarnRemoteException,
+ IOException {
List<QueueInfo> queues = new ArrayList<QueueInfo>();
QueueInfo rootQueue =
@@ -262,7 +268,8 @@ public class YarnClientImpl extends Abst
}
@Override
- public List<QueueInfo> getRootQueueInfos() throws YarnRemoteException {
+ public List<QueueInfo> getRootQueueInfos() throws YarnRemoteException,
+ IOException {
List<QueueInfo> queues = new ArrayList<QueueInfo>();
QueueInfo rootQueue =
@@ -274,7 +281,7 @@ public class YarnClientImpl extends Abst
@Override
public List<QueueInfo> getChildQueueInfos(String parent)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
List<QueueInfo> queues = new ArrayList<QueueInfo>();
QueueInfo parentQueue =
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java Thu May 9 22:46:39 2013
@@ -91,8 +91,9 @@ public class ApplicationCLI extends Yarn
* Lists all the applications present in the Resource Manager
*
* @throws YarnRemoteException
+ * @throws IOException
*/
- private void listAllApplications() throws YarnRemoteException {
+ private void listAllApplications() throws YarnRemoteException, IOException {
PrintWriter writer = new PrintWriter(sysout);
List<ApplicationReport> appsReport = client.getApplicationList();
@@ -117,8 +118,10 @@ public class ApplicationCLI extends Yarn
*
* @param applicationId
* @throws YarnRemoteException
+ * @throws IOException
*/
- private void killApplication(String applicationId) throws YarnRemoteException {
+ private void killApplication(String applicationId)
+ throws YarnRemoteException, IOException {
ApplicationId appId = ConverterUtils.toApplicationId(applicationId);
sysout.println("Killing application " + applicationId);
client.killApplication(appId);
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/NodeCLI.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/NodeCLI.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/NodeCLI.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/NodeCLI.java Thu May 9 22:46:39 2013
@@ -84,8 +84,9 @@ public class NodeCLI extends YarnCLI {
* Lists all the nodes present in the cluster
*
* @throws YarnRemoteException
+ * @throws IOException
*/
- private void listClusterNodes() throws YarnRemoteException {
+ private void listClusterNodes() throws YarnRemoteException, IOException {
PrintWriter writer = new PrintWriter(sysout);
List<NodeReport> nodesReport = client.getNodeReports();
writer.println("Total Nodes:" + nodesReport.size());
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestAMRMClient.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestAMRMClient.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestAMRMClient.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestAMRMClient.java Thu May 9 22:46:39 2013
@@ -23,6 +23,7 @@ import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
@@ -69,7 +70,7 @@ public class TestAMRMClient {
int nodeCount = 3;
@Before
- public void setup() throws YarnRemoteException {
+ public void setup() throws YarnRemoteException, IOException {
// start minicluster
conf = new YarnConfiguration();
yarnCluster = new MiniYARNCluster(TestAMRMClient.class.getName(), nodeCount, 1, 1);
@@ -134,7 +135,7 @@ public class TestAMRMClient {
}
@Test (timeout=60000)
- public void testAMRMClient() throws YarnRemoteException {
+ public void testAMRMClient() throws YarnRemoteException, IOException {
AMRMClientImpl amClient = null;
try {
// start am rm client
@@ -158,7 +159,7 @@ public class TestAMRMClient {
private void testAllocation(final AMRMClientImpl amClient)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
// setup container request
final Resource capability = Records.newRecord(Resource.class);
final Priority priority = Records.newRecord(Priority.class);
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestYarnClient.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestYarnClient.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestYarnClient.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestYarnClient.java Thu May 9 22:46:39 2013
@@ -23,6 +23,9 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+
import junit.framework.Assert;
import org.apache.hadoop.conf.Configuration;
@@ -89,6 +92,8 @@ public class TestYarnClient {
client.submitApplication(context);
} catch (YarnRemoteException e) {
Assert.fail("Exception is not expected.");
+ } catch (IOException e) {
+ Assert.fail("Exception is not expected.");
}
verify(((MockYarnClient) client).mockReport,times(4 * i + 4))
.getYarnApplicationState();
@@ -115,6 +120,8 @@ public class TestYarnClient {
GetApplicationReportRequest.class))).thenReturn(mockResponse);
} catch (YarnRemoteException e) {
Assert.fail("Exception is not expected.");
+ } catch (IOException e) {
+ Assert.fail("Exception is not expected.");
}
when(mockResponse.getApplicationReport()).thenReturn(mockReport);
}
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-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/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/AMRMProtocolPBClientImpl.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/AMRMProtocolPBClientImpl.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/AMRMProtocolPBClientImpl.java Thu May 9 22:46:39 2013
@@ -68,7 +68,7 @@ public class AMRMProtocolPBClientImpl im
@Override
public AllocateResponse allocate(AllocateRequest request)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
AllocateRequestProto requestProto =
((AllocateRequestPBImpl) request).getProto();
try {
@@ -80,7 +80,8 @@ public class AMRMProtocolPBClientImpl im
@Override
public FinishApplicationMasterResponse finishApplicationMaster(
- FinishApplicationMasterRequest request) throws YarnRemoteException {
+ FinishApplicationMasterRequest request) throws YarnRemoteException,
+ IOException {
FinishApplicationMasterRequestProto requestProto =
((FinishApplicationMasterRequestPBImpl) request).getProto();
try {
@@ -93,7 +94,8 @@ public class AMRMProtocolPBClientImpl im
@Override
public RegisterApplicationMasterResponse registerApplicationMaster(
- RegisterApplicationMasterRequest request) throws YarnRemoteException {
+ RegisterApplicationMasterRequest request) throws YarnRemoteException,
+ IOException {
RegisterApplicationMasterRequestProto requestProto =
((RegisterApplicationMasterRequestPBImpl) request).getProto();
try {
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-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/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java Thu May 9 22:46:39 2013
@@ -113,7 +113,7 @@ public class ClientRMProtocolPBClientImp
@Override
public KillApplicationResponse forceKillApplication(
- KillApplicationRequest request) throws YarnRemoteException {
+ KillApplicationRequest request) throws YarnRemoteException, IOException {
KillApplicationRequestProto requestProto =
((KillApplicationRequestPBImpl) request).getProto();
try {
@@ -126,7 +126,8 @@ public class ClientRMProtocolPBClientImp
@Override
public GetApplicationReportResponse getApplicationReport(
- GetApplicationReportRequest request) throws YarnRemoteException {
+ GetApplicationReportRequest request) throws YarnRemoteException,
+ IOException {
GetApplicationReportRequestProto requestProto =
((GetApplicationReportRequestPBImpl) request).getProto();
try {
@@ -139,7 +140,8 @@ public class ClientRMProtocolPBClientImp
@Override
public GetClusterMetricsResponse getClusterMetrics(
- GetClusterMetricsRequest request) throws YarnRemoteException {
+ GetClusterMetricsRequest request) throws YarnRemoteException,
+ IOException {
GetClusterMetricsRequestProto requestProto =
((GetClusterMetricsRequestPBImpl) request).getProto();
try {
@@ -152,7 +154,8 @@ public class ClientRMProtocolPBClientImp
@Override
public GetNewApplicationResponse getNewApplication(
- GetNewApplicationRequest request) throws YarnRemoteException {
+ GetNewApplicationRequest request) throws YarnRemoteException,
+ IOException {
GetNewApplicationRequestProto requestProto =
((GetNewApplicationRequestPBImpl) request).getProto();
try {
@@ -165,7 +168,8 @@ public class ClientRMProtocolPBClientImp
@Override
public SubmitApplicationResponse submitApplication(
- SubmitApplicationRequest request) throws YarnRemoteException {
+ SubmitApplicationRequest request) throws YarnRemoteException,
+ IOException {
SubmitApplicationRequestProto requestProto =
((SubmitApplicationRequestPBImpl) request).getProto();
try {
@@ -178,7 +182,8 @@ public class ClientRMProtocolPBClientImp
@Override
public GetAllApplicationsResponse getAllApplications(
- GetAllApplicationsRequest request) throws YarnRemoteException {
+ GetAllApplicationsRequest request) throws YarnRemoteException,
+ IOException {
GetAllApplicationsRequestProto requestProto =
((GetAllApplicationsRequestPBImpl) request).getProto();
try {
@@ -192,7 +197,7 @@ public class ClientRMProtocolPBClientImp
@Override
public GetClusterNodesResponse
getClusterNodes(GetClusterNodesRequest request)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
GetClusterNodesRequestProto requestProto =
((GetClusterNodesRequestPBImpl) request).getProto();
try {
@@ -205,7 +210,7 @@ public class ClientRMProtocolPBClientImp
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
GetQueueInfoRequestProto requestProto =
((GetQueueInfoRequestPBImpl) request).getProto();
try {
@@ -218,7 +223,8 @@ public class ClientRMProtocolPBClientImp
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
- GetQueueUserAclsInfoRequest request) throws YarnRemoteException {
+ GetQueueUserAclsInfoRequest request) throws YarnRemoteException,
+ IOException {
GetQueueUserAclsInfoRequestProto requestProto =
((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
try {
@@ -231,7 +237,8 @@ public class ClientRMProtocolPBClientImp
@Override
public GetDelegationTokenResponse getDelegationToken(
- GetDelegationTokenRequest request) throws YarnRemoteException {
+ GetDelegationTokenRequest request) throws YarnRemoteException,
+ IOException {
GetDelegationTokenRequestProto requestProto =
((GetDelegationTokenRequestPBImpl) request).getProto();
try {
@@ -244,7 +251,8 @@ public class ClientRMProtocolPBClientImp
@Override
public RenewDelegationTokenResponse renewDelegationToken(
- RenewDelegationTokenRequest request) throws YarnRemoteException {
+ RenewDelegationTokenRequest request) throws YarnRemoteException,
+ IOException {
RenewDelegationTokenRequestProto requestProto =
((RenewDelegationTokenRequestPBImpl) request).getProto();
try {
@@ -257,7 +265,8 @@ public class ClientRMProtocolPBClientImp
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
- CancelDelegationTokenRequest request) throws YarnRemoteException {
+ CancelDelegationTokenRequest request) throws YarnRemoteException,
+ IOException {
CancelDelegationTokenRequestProto requestProto =
((CancelDelegationTokenRequestPBImpl) request).getProto();
try {
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-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/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/AMRMProtocolPBServiceImpl.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/AMRMProtocolPBServiceImpl.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/AMRMProtocolPBServiceImpl.java Thu May 9 22:46:39 2013
@@ -18,6 +18,8 @@
package org.apache.hadoop.yarn.api.impl.pb.service;
+import java.io.IOException;
+
import org.apache.hadoop.yarn.api.AMRMProtocol;
import org.apache.hadoop.yarn.api.AMRMProtocolPB;
import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse;
@@ -57,6 +59,8 @@ public class AMRMProtocolPBServiceImpl i
return ((AllocateResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -70,6 +74,8 @@ public class AMRMProtocolPBServiceImpl i
return ((FinishApplicationMasterResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -83,6 +89,8 @@ public class AMRMProtocolPBServiceImpl i
return ((RegisterApplicationMasterResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
}
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-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/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java Thu May 9 22:46:39 2013
@@ -18,6 +18,8 @@
package org.apache.hadoop.yarn.api.impl.pb.service;
+import java.io.IOException;
+
import org.apache.hadoop.security.proto.SecurityProtos.CancelDelegationTokenRequestProto;
import org.apache.hadoop.security.proto.SecurityProtos.CancelDelegationTokenResponseProto;
import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenRequestProto;
@@ -102,6 +104,8 @@ public class ClientRMProtocolPBServiceIm
return ((KillApplicationResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -115,6 +119,8 @@ public class ClientRMProtocolPBServiceIm
return ((GetApplicationReportResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -127,6 +133,8 @@ public class ClientRMProtocolPBServiceIm
return ((GetClusterMetricsResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -140,6 +148,8 @@ public class ClientRMProtocolPBServiceIm
return ((GetNewApplicationResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -152,6 +162,8 @@ public class ClientRMProtocolPBServiceIm
return ((SubmitApplicationResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -166,6 +178,8 @@ public class ClientRMProtocolPBServiceIm
return ((GetAllApplicationsResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -179,6 +193,8 @@ public class ClientRMProtocolPBServiceIm
return ((GetClusterNodesResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -192,6 +208,8 @@ public class ClientRMProtocolPBServiceIm
return ((GetQueueInfoResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -206,6 +224,8 @@ public class ClientRMProtocolPBServiceIm
return ((GetQueueUserAclsInfoResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -220,6 +240,8 @@ public class ClientRMProtocolPBServiceIm
return ((GetDelegationTokenResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -234,6 +256,8 @@ public class ClientRMProtocolPBServiceIm
return ((RenewDelegationTokenResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
@@ -248,6 +272,8 @@ public class ClientRMProtocolPBServiceIm
return ((CancelDelegationTokenResponsePBImpl)response).getProto();
} catch (YarnRemoteException e) {
throw new ServiceException(e);
+ } catch (IOException e) {
+ throw new ServiceException(e);
}
}
}
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/TestRPCFactories.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/TestRPCFactories.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/TestRPCFactories.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/TestRPCFactories.java Thu May 9 22:46:39 2013
@@ -18,6 +18,7 @@
package org.apache.hadoop.yarn;
+import java.io.IOException;
import java.net.InetSocketAddress;
import junit.framework.Assert;
@@ -107,21 +108,23 @@ public class TestRPCFactories {
@Override
public RegisterApplicationMasterResponse registerApplicationMaster(
- RegisterApplicationMasterRequest request) throws YarnRemoteException {
+ RegisterApplicationMasterRequest request) throws YarnRemoteException,
+ IOException {
// TODO Auto-generated method stub
return null;
}
@Override
public FinishApplicationMasterResponse finishApplicationMaster(
- FinishApplicationMasterRequest request) throws YarnRemoteException {
+ FinishApplicationMasterRequest request) throws YarnRemoteException,
+ IOException {
// TODO Auto-generated method stub
return null;
}
@Override
public AllocateResponse allocate(AllocateRequest request)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
// TODO Auto-generated method stub
return null;
}
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java Thu May 9 22:46:39 2013
@@ -21,7 +21,9 @@ package org.apache.hadoop.yarn.server.re
import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -39,6 +41,11 @@ import org.apache.hadoop.yarn.api.protoc
import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse;
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest;
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.PreemptionContainer;
+import org.apache.hadoop.yarn.api.protocolrecords.PreemptionContract;
+import org.apache.hadoop.yarn.api.protocolrecords.PreemptionResourceRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.StrictPreemptionContract;
+import org.apache.hadoop.yarn.api.protocolrecords.PreemptionMessage;
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest;
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
@@ -162,7 +169,8 @@ public class ApplicationMasterService ex
@Override
public RegisterApplicationMasterResponse registerApplicationMaster(
- RegisterApplicationMasterRequest request) throws YarnRemoteException {
+ RegisterApplicationMasterRequest request) throws YarnRemoteException,
+ IOException {
ApplicationAttemptId applicationAttemptId = request
.getApplicationAttemptId();
@@ -211,7 +219,8 @@ public class ApplicationMasterService ex
@Override
public FinishApplicationMasterResponse finishApplicationMaster(
- FinishApplicationMasterRequest request) throws YarnRemoteException {
+ FinishApplicationMasterRequest request) throws YarnRemoteException,
+ IOException {
ApplicationAttemptId applicationAttemptId = request
.getApplicationAttemptId();
@@ -243,7 +252,7 @@ public class ApplicationMasterService ex
@Override
public AllocateResponse allocate(AllocateRequest request)
- throws YarnRemoteException {
+ throws YarnRemoteException, IOException {
ApplicationAttemptId appAttemptId = request.getApplicationAttemptId();
authorizeRequest(appAttemptId);
@@ -339,9 +348,65 @@ public class ApplicationMasterService ex
}
allocateResponse.setNumClusterNodes(this.rScheduler.getNumClusterNodes());
+
+ // add preemption to the allocateResponse message (if any)
+ allocateResponse.setPreemptionMessage(generatePreemptionMessage(allocation));
+
return allocateResponse;
}
}
+
+ private PreemptionMessage generatePreemptionMessage(Allocation allocation){
+ PreemptionMessage pMsg = null;
+ // assemble strict preemption request
+ if (allocation.getStrictContainerPreemptions() != null) {
+ pMsg =
+ recordFactory.newRecordInstance(PreemptionMessage.class);
+ StrictPreemptionContract pStrict =
+ recordFactory.newRecordInstance(StrictPreemptionContract.class);
+ Set<PreemptionContainer> pCont = new HashSet<PreemptionContainer>();
+ for (ContainerId cId : allocation.getStrictContainerPreemptions()) {
+ PreemptionContainer pc =
+ recordFactory.newRecordInstance(PreemptionContainer.class);
+ pc.setId(cId);
+ pCont.add(pc);
+ }
+ pStrict.setContainers(pCont);
+ pMsg.setStrictContract(pStrict);
+ }
+
+ // assemble negotiable preemption request
+ if (allocation.getResourcePreemptions() != null &&
+ allocation.getResourcePreemptions().size() > 0 &&
+ allocation.getContainerPreemptions() != null &&
+ allocation.getContainerPreemptions().size() > 0) {
+ if (pMsg == null) {
+ pMsg =
+ recordFactory.newRecordInstance(PreemptionMessage.class);
+ }
+ PreemptionContract contract =
+ recordFactory.newRecordInstance(PreemptionContract.class);
+ Set<PreemptionContainer> pCont = new HashSet<PreemptionContainer>();
+ for (ContainerId cId : allocation.getContainerPreemptions()) {
+ PreemptionContainer pc =
+ recordFactory.newRecordInstance(PreemptionContainer.class);
+ pc.setId(cId);
+ pCont.add(pc);
+ }
+ List<PreemptionResourceRequest> pRes = new ArrayList<PreemptionResourceRequest>();
+ for (ResourceRequest crr : allocation.getResourcePreemptions()) {
+ PreemptionResourceRequest prr =
+ recordFactory.newRecordInstance(PreemptionResourceRequest.class);
+ prr.setResourceRequest(crr);
+ pRes.add(prr);
+ }
+ contract.setContainers(pCont);
+ contract.setResourceRequest(pRes);
+ pMsg.setContract(contract);
+ }
+
+ return pMsg;
+ }
public void registerAppAttempt(ApplicationAttemptId attemptId) {
AllocateResponse response =
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Allocation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Allocation.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Allocation.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Allocation.java Thu May 9 22:46:39 2013
@@ -19,17 +19,43 @@
package org.apache.hadoop.yarn.server.resourcemanager.scheduler;
import java.util.List;
+import java.util.Set;
import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.Resource;
+import org.apache.hadoop.yarn.api.records.ResourceRequest;
+import org.apache.hadoop.yarn.factories.RecordFactory;
+import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
public class Allocation {
+
+ private final RecordFactory recordFactory =
+ RecordFactoryProvider.getRecordFactory(null);
+
final List<Container> containers;
final Resource resourceLimit;
-
+ final Set<ContainerId> strictContainers;
+ final Set<ContainerId> fungibleContainers;
+ final List<ResourceRequest> fungibleResources;
+
public Allocation(List<Container> containers, Resource resourceLimit) {
+ this(containers, resourceLimit, null, null, null);
+ }
+
+ public Allocation(List<Container> containers, Resource resourceLimit,
+ Set<ContainerId> strictContainers) {
+ this(containers, resourceLimit, strictContainers, null, null);
+ }
+
+ public Allocation(List<Container> containers, Resource resourceLimit,
+ Set<ContainerId> strictContainers, Set<ContainerId> fungibleContainers,
+ List<ResourceRequest> fungibleResources) {
this.containers = containers;
this.resourceLimit = resourceLimit;
+ this.strictContainers = strictContainers;
+ this.fungibleContainers = fungibleContainers;
+ this.fungibleResources = fungibleResources;
}
public List<Container> getContainers() {
@@ -39,5 +65,17 @@ public class Allocation {
public Resource getResourceLimit() {
return resourceLimit;
}
-
+
+ public Set<ContainerId> getStrictContainerPreemptions() {
+ return strictContainers;
+ }
+
+ public Set<ContainerId> getContainerPreemptions() {
+ return fungibleContainers;
+ }
+
+ public List<ResourceRequest> getResourcePreemptions() {
+ return fungibleResources;
+ }
+
}
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java Thu May 9 22:46:39 2013
@@ -43,6 +43,7 @@ import org.apache.hadoop.yarn.api.record
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.server.resourcemanager.resource.Resources;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState;
+import org.apache.hadoop.yarn.util.BuilderUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,13 +60,17 @@ public class QueueMetrics implements Met
@Metric("# of apps failed") MutableGaugeInt appsFailed;
@Metric("Allocated memory in MB") MutableGaugeInt allocatedMB;
+ @Metric("Allocated CPU in virtual cores") MutableGaugeInt allocatedVCores;
@Metric("# of allocated containers") MutableGaugeInt allocatedContainers;
@Metric("Aggregate # of allocated containers") MutableCounterLong aggregateContainersAllocated;
@Metric("Aggregate # of released containers") MutableCounterLong aggregateContainersReleased;
@Metric("Available memory in MB") MutableGaugeInt availableMB;
+ @Metric("Available CPU in virtual cores") MutableGaugeInt availableVCores;
@Metric("Pending memory allocation in MB") MutableGaugeInt pendingMB;
+ @Metric("Pending CPU allocation in virtual cores") MutableGaugeInt pendingVCores;
@Metric("# of pending containers") MutableGaugeInt pendingContainers;
@Metric("# of reserved memory in MB") MutableGaugeInt reservedMB;
+ @Metric("Reserved CPU in virtual cores") MutableGaugeInt reservedVCores;
@Metric("# of reserved containers") MutableGaugeInt reservedContainers;
@Metric("# of active users") MutableGaugeInt activeUsers;
@Metric("# of active users") MutableGaugeInt activeApplications;
@@ -267,6 +272,7 @@ public class QueueMetrics implements Met
*/
public void setAvailableResourcesToQueue(Resource limit) {
availableMB.set(limit.getMemory());
+ availableVCores.set(limit.getVirtualCores());
}
/**
@@ -303,6 +309,7 @@ public class QueueMetrics implements Met
private void _incrPendingResources(int containers, Resource res) {
pendingContainers.incr(containers);
pendingMB.incr(res.getMemory());
+ pendingVCores.incr(res.getVirtualCores());
}
public void decrPendingResources(String user, int containers, Resource res) {
@@ -319,12 +326,14 @@ public class QueueMetrics implements Met
private void _decrPendingResources(int containers, Resource res) {
pendingContainers.decr(containers);
pendingMB.decr(res.getMemory());
+ pendingVCores.decr(res.getVirtualCores());
}
public void allocateResources(String user, int containers, Resource res) {
allocatedContainers.incr(containers);
aggregateContainersAllocated.incr(containers);
allocatedMB.incr(res.getMemory() * containers);
+ allocatedVCores.incr(res.getVirtualCores() * containers);
_decrPendingResources(containers, Resources.multiply(res, containers));
QueueMetrics userMetrics = getUserMetrics(user);
if (userMetrics != null) {
@@ -339,6 +348,7 @@ public class QueueMetrics implements Met
allocatedContainers.decr(containers);
aggregateContainersReleased.incr(containers);
allocatedMB.decr(res.getMemory() * containers);
+ allocatedVCores.decr(res.getVirtualCores() * containers);
QueueMetrics userMetrics = getUserMetrics(user);
if (userMetrics != null) {
userMetrics.releaseResources(user, containers, res);
@@ -351,6 +361,7 @@ public class QueueMetrics implements Met
public void reserveResource(String user, Resource res) {
reservedContainers.incr();
reservedMB.incr(res.getMemory());
+ reservedVCores.incr(res.getVirtualCores());
QueueMetrics userMetrics = getUserMetrics(user);
if (userMetrics != null) {
userMetrics.reserveResource(user, res);
@@ -363,6 +374,7 @@ public class QueueMetrics implements Met
public void unreserveResource(String user, Resource res) {
reservedContainers.decr();
reservedMB.decr(res.getMemory());
+ reservedVCores.decr(res.getVirtualCores());
QueueMetrics userMetrics = getUserMetrics(user);
if (userMetrics != null) {
userMetrics.unreserveResource(user, res);
@@ -425,10 +437,18 @@ public class QueueMetrics implements Met
public int getAppsFailed() {
return appsFailed.value();
}
+
+ public Resource getAllocatedResources() {
+ return BuilderUtils.newResource(allocatedMB.value(), 0);
+ }
public int getAllocatedMB() {
return allocatedMB.value();
}
+
+ public int getAllocatedVirtualCores() {
+ return allocatedVCores.value();
+ }
public int getAllocatedContainers() {
return allocatedContainers.value();
@@ -437,10 +457,18 @@ public class QueueMetrics implements Met
public int getAvailableMB() {
return availableMB.value();
}
+
+ public int getAvailableVirtualCores() {
+ return availableVCores.value();
+ }
public int getPendingMB() {
return pendingMB.value();
}
+
+ public int getPendingVirtualCores() {
+ return pendingVCores.value();
+ }
public int getPendingContainers() {
return pendingContainers.value();
@@ -449,6 +477,10 @@ public class QueueMetrics implements Met
public int getReservedMB() {
return reservedMB.value();
}
+
+ public int getReservedVirtualCores() {
+ return reservedVCores.value();
+ }
public int getReservedContainers() {
return reservedContainers.value();
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSLeafQueue.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSLeafQueue.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSLeafQueue.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSLeafQueue.java Thu May 9 22:46:39 2013
@@ -28,6 +28,8 @@ import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.classification.InterfaceAudience.Private;
+import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authorize.AccessControlList;
import org.apache.hadoop.yarn.api.records.QueueACL;
@@ -35,6 +37,8 @@ import org.apache.hadoop.yarn.api.record
import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.server.resourcemanager.resource.Resources;
+@Private
+@Unstable
public class FSLeafQueue extends FSQueue {
private static final Log LOG = LogFactory.getLog(
FSLeafQueue.class.getName());
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSParentQueue.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSParentQueue.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSParentQueue.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSParentQueue.java Thu May 9 22:46:39 2013
@@ -25,12 +25,16 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.classification.InterfaceAudience.Private;
+import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.yarn.api.records.QueueACL;
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo;
import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.server.resourcemanager.resource.Resources;
+@Private
+@Unstable
public class FSParentQueue extends FSQueue {
private static final Log LOG = LogFactory.getLog(
FSParentQueue.class.getName());
Modified: hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSQueue.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSQueue.java?rev=1480824&r1=1480823&r2=1480824&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSQueue.java (original)
+++ hadoop/common/branches/HDFS-2802/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSQueue.java Thu May 9 22:46:39 2013
@@ -23,6 +23,8 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
+import org.apache.hadoop.classification.InterfaceAudience.Private;
+import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authorize.AccessControlList;
import org.apache.hadoop.yarn.api.records.Priority;
@@ -36,6 +38,8 @@ import org.apache.hadoop.yarn.server.res
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics;
+@Private
+@Unstable
public abstract class FSQueue extends Schedulable implements Queue {
private final String name;
private final QueueManager queueMgr;