1  import os 
 5      """ 
 6      Resolves paths to files added through 
 7      L{SparkContext.addFile()<pyspark.context.SparkContext.addFile>}. 
 8   
 9      SparkFiles contains only classmethods; users should not create SparkFiles 
10      instances. 
11      """ 
12   
13      _root_directory = None 
14      _is_running_on_worker = False 
15      _sc = None 
16   
18          raise NotImplementedError("Do not construct SparkFiles objects") 
 19   
20      @classmethod 
21 -    def get(cls, filename): 
 22          """ 
23          Get the absolute path of a file added through C{SparkContext.addFile()}. 
24          """ 
25          path = os.path.join(SparkFiles.getRootDirectory(), filename) 
26          return os.path.abspath(path) 
 27   
28      @classmethod 
 39