abstractdog commented on a change in pull request #103:
URL: https://github.com/apache/tez/pull/103#discussion_r570498327



##########
File path: tez-dag/src/main/java/org/apache/tez/client/LocalClient.java
##########
@@ -438,7 +447,9 @@ public DAGStatus apply(Set<StatusGetOpts> statusOpts, Long 
timeout) {
   public boolean shutdownSession(Configuration configuration, ApplicationId 
sessionAppId,
       UserGroupInformation ugi) throws TezException, IOException, 
ServiceException {
     if (isLocalWithoutNetwork) {
-      clientHandler.shutdownAM();
+      if (clientHandler != null){
+        clientHandler.shutdownAM();
+      }
       return true;
     } else {

Review comment:
       right, updating it

##########
File path: tez-dag/src/main/java/org/apache/tez/client/LocalClient.java
##########
@@ -403,7 +405,14 @@ protected DAGAppMaster 
createDAGAppMaster(ApplicationAttemptId applicationAttemp
   @Override
   public TezAppMasterStatus getAMStatus(Configuration configuration, 
ApplicationId appId,
       UserGroupInformation ugi) throws TezException, ServiceException, 
IOException {
-    return clientHandler.getTezAppMasterStatus();
+    if (isLocalWithoutNetwork) {
+      if (clientHandler == null) {
+        return TezAppMasterStatus.INITIALIZING;
+      }
+      return clientHandler.getTezAppMasterStatus();
+    } else {

Review comment:
       else simplification - OK
   yes we need it, this is called from:
   
https://github.com/apache/tez/blob/master/tez-api/src/main/java/org/apache/tez/client/TezClient.java#L834
   
   if we don't want to use LocalClient's own logic for this codepath, we shall 
fallback to the parent's, which is FrameworkClient. getAMStatus (as LocalClient 
is a FrameworkClient)

##########
File path: tez-dag/src/main/java/org/apache/tez/client/LocalClient.java
##########
@@ -403,7 +405,14 @@ protected DAGAppMaster 
createDAGAppMaster(ApplicationAttemptId applicationAttemp
   @Override
   public TezAppMasterStatus getAMStatus(Configuration configuration, 
ApplicationId appId,
       UserGroupInformation ugi) throws TezException, ServiceException, 
IOException {
-    return clientHandler.getTezAppMasterStatus();
+    if (isLocalWithoutNetwork) {
+      if (clientHandler == null) {
+        return TezAppMasterStatus.INITIALIZING;
+      }
+      return clientHandler.getTezAppMasterStatus();
+    } else {

Review comment:
       thanks!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to