@@ -372,6 +372,37 @@ def _getJavaStorageLevel(self, storageLevel):
372372 return newStorageLevel (storageLevel .useDisk , storageLevel .useMemory ,
373373 storageLevel .deserialized , storageLevel .replication )
374374
375+ def setJobGroup (self , groupId , description ):
376+ """
377+ Assigns a group ID to all the jobs started by this thread until the group ID is set to a
378+ different value or cleared.
379+
380+ Often, a unit of execution in an application consists of multiple Spark actions or jobs.
381+ Application programmers can use this method to group all those jobs together and give a
382+ group description. Once set, the Spark web UI will associate such jobs with this group.
383+ """
384+ self ._jsc .setJobGroup (groupId , description )
385+
386+ def setLocalProperty (self , key , value ):
387+ """
388+ Set a local property that affects jobs submitted from this thread, such as the
389+ Spark fair scheduler pool.
390+ """
391+ self ._jsc .setLocalProperty (key , value )
392+
393+ def getLocalProperty (self , key ):
394+ """
395+ Get a local property set in this thread, or null if it is missing. See
396+ L{setLocalProperty}
397+ """
398+ return self ._jsc .getLocalProperty (key )
399+
400+ def sparkUser (self ):
401+ """
402+ Get SPARK_USER for user who is running SparkContext.
403+ """
404+ return self ._jsc .sc ().sparkUser ()
405+
375406def _test ():
376407 import atexit
377408 import doctest
0 commit comments