[04/12] hive git commit: HIVE-16343: LLAP: Publish YARN's ProcFs based memory usage to metrics for monitoring (Prasanth Jayachandran reviewed by Siddharth Seth)

2017-05-30 Thread weiz
HIVE-16343: LLAP: Publish YARN's ProcFs based memory usage to metrics for 
monitoring (Prasanth Jayachandran reviewed by Siddharth Seth)


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

Branch: refs/heads/hive-14535
Commit: c3c6175fb4dbee40cd5f742a49414bf9ecb2f54a
Parents: 573a181
Author: Prasanth Jayachandran 
Authored: Fri May 26 14:16:19 2017 -0700
Committer: Prasanth Jayachandran 
Committed: Fri May 26 14:16:19 2017 -0700

--
 .../apache/hadoop/hive/llap/LlapDaemonInfo.java | 14 +---
 llap-server/bin/runLlapDaemon.sh|  2 +-
 .../hive/llap/daemon/impl/LlapDaemon.java   |  8 ++---
 .../hive/llap/metrics/LlapDaemonJvmInfo.java|  2 ++
 .../hive/llap/metrics/LlapDaemonJvmMetrics.java | 35 +---
 .../hive/llap/daemon/MiniLlapCluster.java   |  2 +-
 6 files changed, 47 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/c3c6175f/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java
--
diff --git 
a/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java 
b/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java
index fa29b59..dae10c8 100644
--- a/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java
+++ b/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java
@@ -25,12 +25,13 @@ public enum LlapDaemonInfo {
 
   private static final class LlapDaemonInfoHolder {
 public LlapDaemonInfoHolder(int numExecutors, long executorMemory, long 
cacheSize,
-boolean isDirectCache, boolean isLlapIo) {
+  boolean isDirectCache, boolean isLlapIo, final String pid) {
   this.numExecutors = numExecutors;
   this.executorMemory = executorMemory;
   this.cacheSize = cacheSize;
   this.isDirectCache = isDirectCache;
   this.isLlapIo = isLlapIo;
+  this.PID = pid;
 }
 
 final int numExecutors;
@@ -38,6 +39,7 @@ public enum LlapDaemonInfo {
 final long cacheSize;
 final boolean isDirectCache;
 final boolean isLlapIo;
+final String PID;
   }
 
   // add more variables as required
@@ -51,13 +53,14 @@ public enum LlapDaemonInfo {
 long ioMemoryBytes = HiveConf.getSizeVar(daemonConf, 
ConfVars.LLAP_IO_MEMORY_MAX_SIZE);
 boolean isDirectCache = HiveConf.getBoolVar(daemonConf, 
ConfVars.LLAP_ALLOCATOR_DIRECT);
 boolean isLlapIo = HiveConf.getBoolVar(daemonConf, 
HiveConf.ConfVars.LLAP_IO_ENABLED, true);
-initialize(appName, numExecutors, executorMemoryBytes, ioMemoryBytes, 
isDirectCache, isLlapIo);
+String pid = System.getenv("JVM_PID");
+initialize(appName, numExecutors, executorMemoryBytes, ioMemoryBytes, 
isDirectCache, isLlapIo, pid);
   }
 
   public static void initialize(String appName, int numExecutors, long 
executorMemoryBytes,
-  long ioMemoryBytes, boolean isDirectCache, boolean isLlapIo) {
+long ioMemoryBytes, boolean isDirectCache, boolean isLlapIo, final String 
pid) {
 INSTANCE.dataRef.set(new LlapDaemonInfoHolder(numExecutors, 
executorMemoryBytes, ioMemoryBytes,
-isDirectCache, isLlapIo));
+isDirectCache, isLlapIo, pid));
   }
 
   public boolean isLlap() {
@@ -89,4 +92,7 @@ public enum LlapDaemonInfo {
 return dataRef.get().isLlapIo;
   }
 
+  public String getPID() {
+return dataRef.get().PID;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/c3c6175f/llap-server/bin/runLlapDaemon.sh
--
diff --git a/llap-server/bin/runLlapDaemon.sh b/llap-server/bin/runLlapDaemon.sh
index 82c2cc5..5a0c10e 100755
--- a/llap-server/bin/runLlapDaemon.sh
+++ b/llap-server/bin/runLlapDaemon.sh
@@ -127,6 +127,6 @@ LLAP_DAEMON_OPTS="${LLAP_DAEMON_OPTS} 
-Dllap.daemon.log.file=${LLAP_DAEMON_LOG_F
 LLAP_DAEMON_OPTS="${LLAP_DAEMON_OPTS} 
-Dllap.daemon.root.logger=${LLAP_DAEMON_LOGGER}"
 LLAP_DAEMON_OPTS="${LLAP_DAEMON_OPTS} 
-Dllap.daemon.log.level=${LLAP_DAEMON_LOG_LEVEL}"
 
+export JVM_PID="$$"
 exec "$JAVA" -Dproc_llapdaemon -Xms${LLAP_DAEMON_HEAPSIZE}m 
-Xmx${LLAP_DAEMON_HEAPSIZE}m ${LLAP_DAEMON_OPTS} -classpath "$CLASSPATH" $CLASS 
"$@"
 
-

http://git-wip-us.apache.org/repos/asf/hive/blob/c3c6175f/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 cfca3f7..68ef200 100644
--- 

hive git commit: HIVE-16343: LLAP: Publish YARN's ProcFs based memory usage to metrics for monitoring (Prasanth Jayachandran reviewed by Siddharth Seth)

2017-05-26 Thread prasanthj
Repository: hive
Updated Branches:
  refs/heads/master 573a1815f -> c3c6175fb


HIVE-16343: LLAP: Publish YARN's ProcFs based memory usage to metrics for 
monitoring (Prasanth Jayachandran reviewed by Siddharth Seth)


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

Branch: refs/heads/master
Commit: c3c6175fb4dbee40cd5f742a49414bf9ecb2f54a
Parents: 573a181
Author: Prasanth Jayachandran 
Authored: Fri May 26 14:16:19 2017 -0700
Committer: Prasanth Jayachandran 
Committed: Fri May 26 14:16:19 2017 -0700

--
 .../apache/hadoop/hive/llap/LlapDaemonInfo.java | 14 +---
 llap-server/bin/runLlapDaemon.sh|  2 +-
 .../hive/llap/daemon/impl/LlapDaemon.java   |  8 ++---
 .../hive/llap/metrics/LlapDaemonJvmInfo.java|  2 ++
 .../hive/llap/metrics/LlapDaemonJvmMetrics.java | 35 +---
 .../hive/llap/daemon/MiniLlapCluster.java   |  2 +-
 6 files changed, 47 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/c3c6175f/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java
--
diff --git 
a/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java 
b/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java
index fa29b59..dae10c8 100644
--- a/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java
+++ b/llap-common/src/java/org/apache/hadoop/hive/llap/LlapDaemonInfo.java
@@ -25,12 +25,13 @@ public enum LlapDaemonInfo {
 
   private static final class LlapDaemonInfoHolder {
 public LlapDaemonInfoHolder(int numExecutors, long executorMemory, long 
cacheSize,
-boolean isDirectCache, boolean isLlapIo) {
+  boolean isDirectCache, boolean isLlapIo, final String pid) {
   this.numExecutors = numExecutors;
   this.executorMemory = executorMemory;
   this.cacheSize = cacheSize;
   this.isDirectCache = isDirectCache;
   this.isLlapIo = isLlapIo;
+  this.PID = pid;
 }
 
 final int numExecutors;
@@ -38,6 +39,7 @@ public enum LlapDaemonInfo {
 final long cacheSize;
 final boolean isDirectCache;
 final boolean isLlapIo;
+final String PID;
   }
 
   // add more variables as required
@@ -51,13 +53,14 @@ public enum LlapDaemonInfo {
 long ioMemoryBytes = HiveConf.getSizeVar(daemonConf, 
ConfVars.LLAP_IO_MEMORY_MAX_SIZE);
 boolean isDirectCache = HiveConf.getBoolVar(daemonConf, 
ConfVars.LLAP_ALLOCATOR_DIRECT);
 boolean isLlapIo = HiveConf.getBoolVar(daemonConf, 
HiveConf.ConfVars.LLAP_IO_ENABLED, true);
-initialize(appName, numExecutors, executorMemoryBytes, ioMemoryBytes, 
isDirectCache, isLlapIo);
+String pid = System.getenv("JVM_PID");
+initialize(appName, numExecutors, executorMemoryBytes, ioMemoryBytes, 
isDirectCache, isLlapIo, pid);
   }
 
   public static void initialize(String appName, int numExecutors, long 
executorMemoryBytes,
-  long ioMemoryBytes, boolean isDirectCache, boolean isLlapIo) {
+long ioMemoryBytes, boolean isDirectCache, boolean isLlapIo, final String 
pid) {
 INSTANCE.dataRef.set(new LlapDaemonInfoHolder(numExecutors, 
executorMemoryBytes, ioMemoryBytes,
-isDirectCache, isLlapIo));
+isDirectCache, isLlapIo, pid));
   }
 
   public boolean isLlap() {
@@ -89,4 +92,7 @@ public enum LlapDaemonInfo {
 return dataRef.get().isLlapIo;
   }
 
+  public String getPID() {
+return dataRef.get().PID;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/c3c6175f/llap-server/bin/runLlapDaemon.sh
--
diff --git a/llap-server/bin/runLlapDaemon.sh b/llap-server/bin/runLlapDaemon.sh
index 82c2cc5..5a0c10e 100755
--- a/llap-server/bin/runLlapDaemon.sh
+++ b/llap-server/bin/runLlapDaemon.sh
@@ -127,6 +127,6 @@ LLAP_DAEMON_OPTS="${LLAP_DAEMON_OPTS} 
-Dllap.daemon.log.file=${LLAP_DAEMON_LOG_F
 LLAP_DAEMON_OPTS="${LLAP_DAEMON_OPTS} 
-Dllap.daemon.root.logger=${LLAP_DAEMON_LOGGER}"
 LLAP_DAEMON_OPTS="${LLAP_DAEMON_OPTS} 
-Dllap.daemon.log.level=${LLAP_DAEMON_LOG_LEVEL}"
 
+export JVM_PID="$$"
 exec "$JAVA" -Dproc_llapdaemon -Xms${LLAP_DAEMON_HEAPSIZE}m 
-Xmx${LLAP_DAEMON_HEAPSIZE}m ${LLAP_DAEMON_OPTS} -classpath "$CLASSPATH" $CLASS 
"$@"
 
-

http://git-wip-us.apache.org/repos/asf/hive/blob/c3c6175f/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