hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject hive git commit: HIVE-16403 : LLAP UI shows the wrong number of executors (Sergey Shelukhin, reviewed by Gopal Vijayaraghavan)
Date Tue, 11 Apr 2017 19:19:03 GMT
Repository: hive
Updated Branches:
  refs/heads/master 5facfbb86 -> 3bf477a1b


HIVE-16403 : LLAP UI shows the wrong number of executors (Sergey Shelukhin, reviewed by Gopal
Vijayaraghavan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/3bf477a1
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/3bf477a1
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/3bf477a1

Branch: refs/heads/master
Commit: 3bf477a1bc1a200fcf9c09436b0bfb830945d9ee
Parents: 5facfbb
Author: Sergey Shelukhin <sershe@apache.org>
Authored: Tue Apr 11 12:17:18 2017 -0700
Committer: Sergey Shelukhin <sershe@apache.org>
Committed: Tue Apr 11 12:17:18 2017 -0700

----------------------------------------------------------------------
 .../hive/llap/daemon/impl/ContainerRunnerImpl.java    |  4 ++++
 .../hadoop/hive/llap/daemon/impl/LlapDaemon.java      |  5 +++++
 .../hive/llap/daemon/impl/LlapDaemonMXBean.java       |  6 ++++++
 .../hadoop/hive/llap/daemon/impl/Scheduler.java       |  2 ++
 .../hive/llap/daemon/impl/TaskExecutorService.java    | 14 ++++++++++++++
 .../main/resources/hive-webapps/llap/js/metrics.js    |  6 +++---
 6 files changed, 34 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/3bf477a1/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
index 82bbcf3..e030a76 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
@@ -524,4 +524,8 @@ public class ContainerRunnerImpl extends CompositeService implements ContainerRu
     return queryId + "-" + dagIndex;
   }
 
+  public int getNumActive() {
+    return executorService.getNumActive();
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/3bf477a1/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java
index 30f9ad4..4f09f41 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java
@@ -600,6 +600,11 @@ public class LlapDaemon extends CompositeService implements ContainerRunner,
Lla
   }
 
   @Override
+  public int getNumActive() {
+    return containerRunner.getNumActive();
+  }
+
+  @Override
   public long getExecutorMemoryPerInstance() {
     return executorMemoryPerInstance;
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/3bf477a1/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemonMXBean.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemonMXBean.java
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemonMXBean.java
index d6449db..22cfc9e 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemonMXBean.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemonMXBean.java
@@ -40,6 +40,12 @@ public interface LlapDaemonMXBean {
   public int getNumExecutors();
 
   /**
+   * Gets the number of active executors.
+   * @return number of active executors
+   */
+  public int getNumActive();
+
+  /**
    * Gets the shuffle port.
    * @return the shuffle port
    */

http://git-wip-us.apache.org/repos/asf/hive/blob/3bf477a1/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/Scheduler.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/Scheduler.java b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/Scheduler.java
index fd6234a..f199593 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/Scheduler.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/Scheduler.java
@@ -45,5 +45,7 @@ public interface Scheduler<T> {
 
   Set<String> getExecutorsStatus();
 
+  int getNumActive();
+
   QueryIdentifier findQueryByFragment(String fragmentId);
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/3bf477a1/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskExecutorService.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskExecutorService.java
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskExecutorService.java
index 4f2e325..7f8c947 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskExecutorService.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskExecutorService.java
@@ -201,6 +201,20 @@ public class TaskExecutorService extends AbstractService
   };
 
   @Override
+  public int getNumActive() {
+    int result = 0;
+    for (Map.Entry<String, TaskWrapper> e : knownTasks.entrySet()) {
+      TaskWrapper task = e.getValue();
+      if (task.isInWaitQueue()) continue;
+      TaskRunnerCallable c = task.getTaskRunnerCallable();
+      // Count the tasks in intermediate state as waiting.
+      if (c == null || c.getStartTime() == 0) continue;
+      ++result;
+    }
+    return result;
+  }
+
+  @Override
   public Set<String> getExecutorsStatus() {
     // TODO Change this method to make the output easier to parse (parse programmatically)
     Set<String> result = new LinkedHashSet<>();

http://git-wip-us.apache.org/repos/asf/hive/blob/3bf477a1/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js
----------------------------------------------------------------------
diff --git a/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js b/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js
index 4c41c34..0db9a05 100644
--- a/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js
+++ b/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js
@@ -103,8 +103,8 @@ llap.model.LlapDaemonInfo = new function() {
    this.push = function(jmx) {
       var bean = jmxbean(jmx, this.name); 
       this.executors = bean["NumExecutors"];
-      this.active = bean["ExecutorsStatus"];
-      this.active_rate.add(this.active.length);
+      this.active = bean["NumActive"];
+      this.active_rate.add(this.active);
    }
 }
 
@@ -175,7 +175,7 @@ llap.view.Cache = new function () {
 llap.view.Executors = new function () {
    this.refresh = function() {
       var model = llap.model.LlapDaemonInfo;
-      $("#executors-used").text(model.active.length);
+      $("#executors-used").text(model.active);
       $("#executors-max").text(model.executors);
       $("#executors-rate").text(((model.active_rate.peek() * 100.0)/model.executors).toFixed(0));
       $("#executors-trend").sparkline(model.active_rate);


Mime
View raw message