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

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

                Author: ASF GitHub Bot
            Created on: 27/Jun/19 18:13
            Start Date: 27/Jun/19 18:13
    Worklog Time Spent: 10m 
      Work Description: odraese commented on pull request #690: HIVE-21910: 
Multiple target location generation in HostAffinitySplitLocationProvider
URL: https://github.com/apache/hive/pull/690#discussion_r298304091
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/HostAffinitySplitLocationProvider.java
 ##########
 @@ -72,11 +78,17 @@ public HostAffinitySplitLocationProvider(List<String> 
knownLocations) {
     FileSplit fsplit = (FileSplit) split;
     String splitDesc = "Split at " + fsplit.getPath() + " with offset= " + 
fsplit.getStart()
         + ", length=" + fsplit.getLength();
-    List<String> preferredLocations = preferLocations(fsplit);
-    String location =
-        preferredLocations.get(determineLocation(preferredLocations, 
fsplit.getPath().toString(),
-            fsplit.getStart(), splitDesc));
-    return (location != null) ? new String[] { location } : null;
+    List<String> preferredLocations = new ArrayList<>(preferLocations(fsplit));
+    List<String> finalLocations = new ArrayList<>(numberOfLocations);
+    // Generate new preferred locations until we need more, or we do not have 
any preferred
+    // location left
+    while (finalLocations.size() < numberOfLocations && 
preferredLocations.size() > 0) {
+      String nextLocation = 
preferredLocations.get(determineLocation(preferredLocations,
+          fsplit.getPath().toString(), fsplit.getStart(), splitDesc));
+      finalLocations.add(nextLocation);
+      preferredLocations.remove(nextLocation);
 
 Review comment:
   Something else to consider: let's say that we generate multiple locations 
for each split now, we will run through the determineLocation multiple times 
(vs. once) to generate locations that most likely are not used later down the 
code path. This means that we spend more cycles on TezAM, potentially 
increasing the query execution time there always where the benefits are only 
seen in rejection cases....
 
----------------------------------------------------------------
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:
[email protected]


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

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

> Multiple target location generation in HostAffinitySplitLocationProvider
> ------------------------------------------------------------------------
>
>                 Key: HIVE-21910
>                 URL: https://issues.apache.org/jira/browse/HIVE-21910
>             Project: Hive
>          Issue Type: Sub-task
>          Components: llap
>            Reporter: Peter Vary
>            Assignee: Peter Vary
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21910.patch
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> We need to generate multiple target locations by 
> HostAffinitySplitLocationProvider, so we will have deterministic fallback 
> nodes in case the target node is disabled



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to