You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2015/11/24 06:41:54 UTC

[2/2] incubator-kylin git commit: KYLIN-1162 be compatible with YARN-2605

KYLIN-1162 be compatible with YARN-2605


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/2178fc16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/2178fc16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/2178fc16

Branch: refs/heads/2.x-staging
Commit: 2178fc1661db469f7e9f7e9f9e07b25a4a5594fe
Parents: eb568c0
Author: shaofengshi <sh...@apache.org>
Authored: Tue Nov 24 11:41:27 2015 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Tue Nov 24 13:41:46 2015 +0800

----------------------------------------------------------------------
 .../engine/mr/common/HadoopStatusGetter.java    | 32 ++++++++++++++------
 1 file changed, 23 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/2178fc16/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java
----------------------------------------------------------------------
diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java
index 7bab771..fd7afd3 100644
--- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java
+++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java
@@ -79,16 +79,27 @@ public class HadoopStatusGetter {
                 client.executeMethod(get);
 
                 String redirect = null;
-                Header h = get.getResponseHeader("Refresh");
+                Header h = get.getResponseHeader("Location");
                 if (h != null) {
-                    String s = h.getValue();
-                    int cut = s.indexOf("url=");
-                    if (cut >= 0) {
-                        redirect = s.substring(cut + 4);
-
-                        if (isValidURL(redirect) == false) {
-                            logger.info("Get invalid redirect url, skip it: " + redirect);
-                            continue;
+                    redirect = h.getValue();
+                    if (isValidURL(redirect) == false) {
+                        logger.info("Get invalid redirect url, skip it: " + redirect);
+                        Thread.sleep(1000l);
+                        continue;
+                    }
+                } else {
+                    h = get.getResponseHeader("Refresh");
+                    if (h != null) {
+                        String s = h.getValue();
+                        int cut = s.indexOf("url=");
+                        if (cut >= 0) {
+                            redirect = s.substring(cut + 4);
+
+                            if (isValidURL(redirect) == false) {
+                                logger.info("Get invalid redirect url, skip it: " + redirect);
+                                Thread.sleep(1000l);
+                                continue;
+                            }
                         }
                     }
                 }
@@ -100,6 +111,8 @@ public class HadoopStatusGetter {
                     url = redirect;
                     logger.debug("Job " + mrJobId + " check redirect url " + url + ".\n");
                 }
+            } catch (InterruptedException e) {
+                logger.error(e.getMessage());
             } finally {
                 get.releaseConnection();
             }
@@ -132,4 +145,5 @@ public class HadoopStatusGetter {
 
         return false;
     }
+    
 }