File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
resource-managers/kubernetes/integration-tests/tests Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 3232 .getOrCreate ()
3333 sc = spark ._sc
3434 acc = sc .accumulator (0 )
35+
3536 def addToAcc (x ):
3637 acc .add (1 )
3738 return x
39+
3840 initialRdd = sc .parallelize (range (100 ), 5 )
3941 accRdd = initialRdd .map (addToAcc )
4042 # Trigger a shuffle so there are shuffle blocks to migrate
4143 rdd = accRdd .map (lambda x : (x , x )).groupByKey ()
4244 rdd .collect ()
43- print ("1st accumulator value is: " + str (acc .value ))
45+ print ("1st accumulator value is: " + str (acc .value ))
4446 print ("Waiting to give nodes time to finish migration, decom exec 1." )
4547 print ("..." )
4648 time .sleep (5 )
@@ -51,7 +53,7 @@ def addToAcc(x):
5153 print ("Executor node should be deleted now" )
5254 rdd .count ()
5355 rdd .collect ()
54- print ("Final accumulator value is: " + str (acc .value ))
56+ print ("Final accumulator value is: " + str (acc .value ))
5557 print ("Finished waiting, stopping Spark." )
5658 spark .stop ()
5759 print ("Done, exiting Python" )
You can’t perform that action at this time.
0 commit comments