From dc8d2412fe8b02b63dbb025567ce00ee94860771 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Sat, 15 Jun 2013 04:58:45 +0000 Subject: [PATCH] YARN-821. Renamed setFinishApplicationStatus to setFinalApplicationStatus in FinishApplicationMasterRequest for consistency. Contributed by Jian He. svn merge --ignore-ancestry -c 1493315 ../../trunk/ git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1493316 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java | 2 +- hadoop-yarn-project/CHANGES.txt | 3 +++ .../protocolrecords/FinishApplicationMasterRequest.java | 8 ++++---- .../impl/pb/FinishApplicationMasterRequestPBImpl.java | 6 +++--- .../org/apache/hadoop/yarn/client/AMRMClientImpl.java | 2 +- .../hadoop/yarn/server/resourcemanager/rmapp/RMApp.java | 4 ++-- .../apache/hadoop/yarn/server/resourcemanager/MockAM.java | 2 +- .../resourcemanager/security/TestApplicationTokens.java | 2 +- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java index 72fc4cab26c..87b6ed6f735 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java @@ -188,7 +188,7 @@ public abstract class RMCommunicator extends AbstractService FinishApplicationMasterRequest request = recordFactory.newRecordInstance(FinishApplicationMasterRequest.class); request.setAppAttemptId(this.applicationAttemptId); - request.setFinishApplicationStatus(finishState); + request.setFinalApplicationStatus(finishState); request.setDiagnostics(sb.toString()); request.setTrackingUrl(historyUrl); scheduler.finishApplicationMaster(request); diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index b51783465d6..3a20604266b 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -126,6 +126,9 @@ Release 2.1.0-beta - UNRELEASED YARN-806. Moved ContainerExitStatus from yarn.api to yarn.api.records. (Jian He via vinodkv) + YARN-821. Renamed setFinishApplicationStatus to setFinalApplicationStatus in + FinishApplicationMasterRequest for consistency. (Jian He via vinodk) + NEW FEATURES YARN-482. FS: Extend SchedulingMode to intermediate queues. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java index 7b95885b81d..0904a85d851 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java @@ -54,7 +54,7 @@ public abstract class FinishApplicationMasterRequest { FinishApplicationMasterRequest request = Records.newRecord(FinishApplicationMasterRequest.class); request.setAppAttemptId(appAttemptId); - request.setFinishApplicationStatus(finalAppStatus); + request.setFinalApplicationStatus(finalAppStatus); request.setDiagnostics(diagnostics); request.setTrackingUrl(url); return request; @@ -89,12 +89,12 @@ public abstract class FinishApplicationMasterRequest { public abstract FinalApplicationStatus getFinalApplicationStatus(); /** - * Set the finish state of the ApplicationMaster - * @param finishState finish state of the ApplicationMaster + * Set the final state of the ApplicationMaster + * @param finalState final state of the ApplicationMaster */ @Public @Stable - public abstract void setFinishApplicationStatus(FinalApplicationStatus finishState); + public abstract void setFinalApplicationStatus(FinalApplicationStatus finalState); /** * Get diagnostic information on application failure. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/FinishApplicationMasterRequestPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/FinishApplicationMasterRequestPBImpl.java index ad3a8220a91..d8f52237f3c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/FinishApplicationMasterRequestPBImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/FinishApplicationMasterRequestPBImpl.java @@ -150,13 +150,13 @@ public class FinishApplicationMasterRequestPBImpl extends FinishApplicationMaste } @Override - public void setFinishApplicationStatus(FinalApplicationStatus finishState) { + public void setFinalApplicationStatus(FinalApplicationStatus finalState) { maybeInitBuilder(); - if (finishState == null) { + if (finalState == null) { builder.clearFinalApplicationStatus(); return; } - builder.setFinalApplicationStatus(convertToProtoFormat(finishState)); + builder.setFinalApplicationStatus(convertToProtoFormat(finalState)); } private ApplicationAttemptIdPBImpl convertFromProtoFormat(ApplicationAttemptIdProto p) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientImpl.java index 3399995988a..86718b00f46 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/AMRMClientImpl.java @@ -272,7 +272,7 @@ public class AMRMClientImpl FinishApplicationMasterRequest request = recordFactory .newRecordInstance(FinishApplicationMasterRequest.class); request.setAppAttemptId(appAttemptId); - request.setFinishApplicationStatus(appStatus); + request.setFinalApplicationStatus(appStatus); if(appMessage != null) { request.setDiagnostics(appMessage); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMApp.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMApp.java index ef113613664..477fcb875bf 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMApp.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMApp.java @@ -168,9 +168,9 @@ public interface RMApp extends EventHandler { /** * The final finish state of the AM when unregistering as in - * {@link FinishApplicationMasterRequest#setFinishApplicationStatus(FinalApplicationStatus)}. + * {@link FinishApplicationMasterRequest#setFinalApplicationStatus(FinalApplicationStatus)}. * @return the final finish state of the AM as set in - * {@link FinishApplicationMasterRequest#setFinishApplicationStatus(FinalApplicationStatus)}. + * {@link FinishApplicationMasterRequest#setFinalApplicationStatus(FinalApplicationStatus)}. */ FinalApplicationStatus getFinalApplicationStatus(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockAM.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockAM.java index 97f392e8990..7fe07112a40 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockAM.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockAM.java @@ -153,7 +153,7 @@ public class MockAM { FinishApplicationMasterRequest req = Records.newRecord(FinishApplicationMasterRequest.class); req.setAppAttemptId(attemptId); req.setDiagnostics(""); - req.setFinishApplicationStatus(FinalApplicationStatus.SUCCEEDED); + req.setFinalApplicationStatus(FinalApplicationStatus.SUCCEEDED); req.setTrackingUrl(""); amRMProtocol.finishApplicationMaster(req); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java index 4fb81c668a2..b74839b98e3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java @@ -116,7 +116,7 @@ public class TestApplicationTokens { Records.newRecord(FinishApplicationMasterRequest.class); finishAMRequest.setAppAttemptId(applicationAttemptId); finishAMRequest - .setFinishApplicationStatus(FinalApplicationStatus.SUCCEEDED); + .setFinalApplicationStatus(FinalApplicationStatus.SUCCEEDED); finishAMRequest.setDiagnostics("diagnostics"); finishAMRequest.setTrackingUrl("url"); rmClient.finishApplicationMaster(finishAMRequest);