hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prasan...@apache.org
Subject hive git commit: HIVE-14197: LLAP service driver precondition failure should include the values (Prasanth Jayachandran reviewed by Siddharth Seth)
Date Fri, 08 Jul 2016 21:04:57 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-2.1 59a50c217 -> e1cec964d


HIVE-14197: LLAP service driver precondition failure should include the values (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/e1cec964
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/e1cec964
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/e1cec964

Branch: refs/heads/branch-2.1
Commit: e1cec964dc120ead9509b1898cc02a2c9260e40a
Parents: 59a50c2
Author: Prasanth Jayachandran <prasanthj@apache.org>
Authored: Fri Jul 8 14:04:15 2016 -0700
Committer: Prasanth Jayachandran <prasanthj@apache.org>
Committed: Fri Jul 8 14:04:47 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hive/llap/cli/LlapServiceDriver.java | 25 ++++++++++++++++----
 1 file changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/e1cec964/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java
index 98faa2c..0edbe7c 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java
@@ -204,7 +204,8 @@ public class LlapServiceDriver {
         if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.LLAP_ALLOCATOR_MAPPED) == false)
{
           // direct heap allocations need to be safer
           Preconditions.checkArgument(options.getCache() < options.getSize(),
-              "Cache has to be smaller than the container sizing");
+              "Cache size (" + humanReadableByteCount(options.getCache()) + ") has to be
smaller" +
+                  " than the container sizing (" + humanReadableByteCount(options.getSize())
+ ")");
         } else if (options.getCache() < options.getSize()) {
           LOG.warn("Note that this might need YARN physical memory monitoring to be turned
off "
               + "(yarn.nodemanager.pmem-check-enabled=false)");
@@ -212,13 +213,18 @@ public class LlapServiceDriver {
       }
       if (options.getXmx() != -1) {
         Preconditions.checkArgument(options.getXmx() < options.getSize(),
-            "Working memory has to be smaller than the container sizing");
+            "Working memory (Xmx=" + humanReadableByteCount(options.getXmx()) + ") has to
be" +
+                " smaller than the container sizing (" +
+                humanReadableByteCount(options.getSize()) + ")");
       }
       if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.LLAP_ALLOCATOR_DIRECT)
           && false == HiveConf.getBoolVar(conf, HiveConf.ConfVars.LLAP_ALLOCATOR_MAPPED))
{
         // direct and not memory mapped
         Preconditions.checkArgument(options.getXmx() + options.getCache() < options.getSize(),
-            "Working memory + cache has to be smaller than the container sizing ");
+            "Working memory + cache (Xmx="+ humanReadableByteCount(options.getXmx()) +
+                " + cache=" + humanReadableByteCount(options.getCache()) + ")"
+                + " has to be smaller than the container sizing (" +
+                humanReadableByteCount(options.getSize()) + ")");
       }
     }
 
@@ -228,7 +234,8 @@ public class LlapServiceDriver {
     if (options.getSize() != -1) {
       containerSize = options.getSize() / (1024 * 1024);
       Preconditions.checkArgument(containerSize >= minAlloc,
-          "Container size should be greater than minimum allocation(%s)", minAlloc + "m");
+          "Container size (" + humanReadableByteCount(options.getSize()) + ") should be greater"
+
+              " than minimum allocation(" + humanReadableByteCount(minAlloc * 1024L * 1024L)
+ ")");
       conf.setLong(ConfVars.LLAP_DAEMON_YARN_CONTAINER_MB.varname, containerSize);
       propsDirectOptions.setProperty(ConfVars.LLAP_DAEMON_YARN_CONTAINER_MB.varname, String.valueOf(containerSize));
     }
@@ -582,5 +589,13 @@ public class LlapServiceDriver {
     lfs.copyFromLocalFile(new Path(conf.getResource(f).toString()), confPath);
   }
 
-
+  private String humanReadableByteCount(long bytes) {
+    int unit = 1024;
+    if (bytes < unit) {
+      return bytes + "B";
+    }
+    int exp = (int) (Math.log(bytes) / Math.log(unit));
+    String suffix = "KMGTPE".charAt(exp-1) + "";
+    return String.format("%.2f%sB", bytes / Math.pow(unit, exp), suffix);
+  }
 }


Mime
View raw message