Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2648#discussion_r18663950
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/AsyncRDDActions.scala ---
    @@ -78,16 +78,17 @@ class AsyncRDDActions[T: ClassTag](self: RDD[T]) 
extends Serializable with Loggi
             // greater than totalParts because we actually cap it at 
totalParts in runJob.
             var numPartsToTry = 1
             if (partsScanned > 0) {
    -          // If we didn't find any rows after the first iteration, just 
try all partitions next.
    +          // If we didn't find any rows after the previous iteration, 
quadruple and retry.
               // Otherwise, interpolate the number of partitions we need to 
try, but overestimate it
    -          // by 50%.
    +          // by 50%. We also cap the estimation in the end.
               if (results.size == 0) {
    -            numPartsToTry = totalParts - 1
    +            numPartsToTry = partsScanned * 4
               } else {
    -            numPartsToTry = (1.5 * num * partsScanned / results.size).toInt
    +            // the left side of max is >=1 whenever partsScanned >= 2
    +            numPartsToTry = ((1.5 * num * partsScanned / 
results.size).toInt - partsScanned) max 1
    +            numPartsToTry = numPartsToTry min (partsScanned * 4) 
    --- End diff --
    
    Infix Methods
    Don't use infix notation for methods that aren't operators. For example, 
instead of list map func, use list.map(func), or instead of string contains 
"foo", use string.contains("foo"). This is to improve familiarity to developers 
coming from other languages.
    
    https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to