[ 
https://issues.apache.org/jira/browse/HIVE-24707?focusedWorklogId=545433&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-545433
 ]

ASF GitHub Bot logged work on HIVE-24707:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Feb/21 16:40
            Start Date: 01/Feb/21 16:40
    Worklog Time Spent: 10m 
      Work Description: pgaref commented on a change in pull request #1933:
URL: https://github.com/apache/hive/pull/1933#discussion_r567969784



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java
##########
@@ -1915,15 +1915,26 @@ private static String getFullyQualifiedName(String... 
names) {
     return result;
   }
 
-  public static long getAvailableMemory(Configuration conf) {
-    int memory = HiveConf.getIntVar(conf, 
HiveConf.ConfVars.HIVETEZCONTAINERSIZE);
-    if (memory <= 0) {
-      memory = conf.getInt(MRJobConfig.MAP_MEMORY_MB, 
MRJobConfig.DEFAULT_MAP_MEMORY_MB);
-      if (memory <= 0) {
-        memory = 1024;
+  /**
+   * Get the Container Memory Size from given conf (in MB).
+   * Returns HIVETEZCONTAINERSIZE when set, otherwise falls back to 
MAP_MEMORY_MB.
+   * When MAP_MEMORY_MB is explicitly set to "-1" uses DEFAULT_MAP_MEMORY_MB 
(1024) to avoid failures.
+   * @param conf Configuration
+   * @param isTez true if in Tez mode
+   * @return Container Memory Size in MB
+   */
+  public static int getAvailableMemory(Configuration conf, boolean isTez) {
+    int containerMemSizeMb = HiveConf.getIntVar(conf, 
HiveConf.ConfVars.HIVETEZCONTAINERSIZE);

Review comment:
       The reason is I reused the logic for MR mode: 
https://github.com/apache/hive/pull/1933/files#diff-e3956e96fab0a8e9604b0e484a2ee7db29b83a62fdae4d08de068e4712191663L67




----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 545433)
    Time Spent: 50m  (was: 40m)

> Apply Sane Default for Tez Containers as Last Resort
> ----------------------------------------------------
>
>                 Key: HIVE-24707
>                 URL: https://issues.apache.org/jira/browse/HIVE-24707
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: Panagiotis Garefalakis
>            Priority: Trivial
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> {code:java|title=DagUtils.java}
> public static Resource getContainerResource(Configuration conf) {
>     int memory = HiveConf.getIntVar(conf, 
> HiveConf.ConfVars.HIVETEZCONTAINERSIZE) > 0 ?
>       HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) :
>       conf.getInt(MRJobConfig.MAP_MEMORY_MB, 
> MRJobConfig.DEFAULT_MAP_MEMORY_MB);
>     int cpus = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) > 
> 0 ?
>       HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) :
>       conf.getInt(MRJobConfig.MAP_CPU_VCORES, 
> MRJobConfig.DEFAULT_MAP_CPU_VCORES);
>     return Resource.newInstance(memory, cpus);
>   }
> {code}
> If Tez Container Size or VCores is an invalid value ( <= 0 ) then it falls 
> back onto the MapReduce configurations, but if the MapReduce configurations 
> have invalid values ( <= 0 ), they are excepted regardless and this will 
> cause failures down the road.
> This code should also check the MapReduce values and fall back to MapReduce 
> default values if they are <= 0.
> Also, some logging would be nice here too, reporting about where the 
> configuration values came from.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to