spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BryanCutler <...@git.apache.org>
Subject [GitHub] spark pull request #18695: [SPARK-12717][PYTHON] Adding thread-safe broadcas...
Date Tue, 01 Aug 2017 03:14:20 GMT
Github user BryanCutler commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18695#discussion_r130511618
  
    --- Diff: python/pyspark/tests.py ---
    @@ -858,6 +858,49 @@ def test_multiple_broadcasts(self):
             self.assertEqual(N, size)
             self.assertEqual(checksum, csum)
     
    +    def test_multithread_broadcast_pickle(self):
    +        import threading
    +
    +        b1 = self.sc.broadcast(list(range(3)))
    +        b2 = self.sc.broadcast(list(range(3)))
    +
    +        def f1():
    +            return b1.value
    +
    +        def f2():
    +            return b2.value
    +
    +        funcs_num_pickled = {f1: None, f2: None}
    +
    +        def do_pickle(f, sc):
    +            command = (f, None, sc.serializer, sc.serializer)
    +            ser = CloudPickleSerializer()
    +            ser.dumps(command)
    +
    +        def process_vars(sc):
    +            broadcast_vars = [x for x in sc._pickled_broadcast_vars]
    +            num_pickled = len(broadcast_vars)
    +            sc._pickled_broadcast_vars.clear()
    --- End diff --
    
    yeah, that would be good


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message