gyfora commented on code in PR #502:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/502#discussion_r1065849691
##########
examples/autoscaling/src/main/java/autoscaling/AutoscalingExample.java:
##########
@@ -29,10 +30,19 @@ public static void main(String[] args) throws Exception {
stream =
stream.shuffle()
.map(
- i -> {
- // Add sleep to artificially slow down
processing
- // Thread.sleep(sleep);
- return i;
+ new RichMapFunction<Long, Long>() {
+ @Override
+ public Long map(Long i) throws Exception {
+ var start = System.nanoTime();
+ var end = System.nanoTime();
+ while (end
+ < start
+ + getRuntimeContext()
+
.getNumberOfParallelSubtasks()) {
+ end = System.nanoTime();
Review Comment:
I will probably remove this from the PR , basically this is a simple way to
wait for a few nanos. Compared to Thread.sleep which sleeps much longer
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]