GitHub user scwf opened a pull request:

    https://github.com/apache/spark/pull/1385

    Optimize SparkContext.hadoopFile api

    1 use SparkContext.hadoopRDD() instead of instantiate HadoopRDD directly in 
SparkContext.hadoopFile.
       SparkContext.hadoopRDD()  Add necessary security credentials to the 
JobConf before broadcasting it.
    
    2 broadcast jobConf in HadoopRDD, not Configuration. this will resolve the 
dead lock issue----
    now HadoopRDD broadcast Configuration and in each task (compute method) to 
get jobConf 
    then the lock of 
     conf.synchronized {
          val newJobConf = new JobConf(conf)
          initLocalJobConfFuncOpt.map(f => f(newJobConf))
          HadoopRDD.putCachedMetadata(jobConfCacheKey, newJobConf)
          newJobConf
         }
    will conflict with hadoop version fix  Hadoop-10456:
    
    
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
    synchronized(Configuration.class) {
           REGISTRY.put(this, null);
         }
    
    we can reproduce the bug like this:
    hadoop version 2.4.1
    spark master branch
    
    hql("SELECT t1.a, t1.b, t1.c FROM table_A t1 JOIN table_A t2 ON (t1.a = 
t2.a)") 
       

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/scwf/spark kasi

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/1385.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1385
    
----
commit c691f3d1cdb770aaafbb025a52c49233cb13c9f7
Author: w00228970 <[email protected]>
Date:   2014-07-12T07:59:04Z

    use SparkContext.hadoopRDD() instead of instantiate HadoopRDD directly in 
SparkContext.hadoopFile

----


---
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.
---

Reply via email to