tgravescs commented on a change in pull request #28085:
[SPARK-29641][PYTHON][CORE] Stage Level Sched: Add python api's and tests
URL: https://github.com/apache/spark/pull/28085#discussion_r407555265
##########
File path: core/src/test/java/test/org/apache/spark/JavaAPISuite.java
##########
@@ -897,6 +901,16 @@ public void persist() {
assertEquals(1, rdd.first().intValue());
}
+ @Test
+ public void withResources() {
+ ExecutorResourceRequests ereqs = new ExecutorResourceRequests().cores(4);
+ TaskResourceRequests treqs = new TaskResourceRequests().cpus(1);
+ ResourceProfile rp1 = new
ResourceProfileBuilder().require(ereqs).require(treqs).build();
+ JavaRDD<Integer> in1 = sc.parallelize(Arrays.asList(1, 2, 3, 4));
+ in1.withResources(rp1);
+ assertEquals(rp1, in1.getResourceProfile());
+ }
Review comment:
this was purely we don't support it in local mode. so before we were doing a
in1.collect() which ended up hanging because we also have the isTesting config
on. it was looking for executor that it would never get. Normally it would
have thrown an exception saying local mode not supported but the isTesting flag
bypassed that check
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]