Github user nekrassov commented on a diff in the pull request:
https://github.com/apache/flink/pull/6247#discussion_r200434401
--- Diff:
flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/async/AsyncIOExample.java
---
@@ -116,8 +116,8 @@ public void cancel() {
private static class SampleAsyncFunction extends
RichAsyncFunction<Integer, String> {
private static final long serialVersionUID =
2098635244857937717L;
- private static ExecutorService executorService;
- private static Random random;
--- End diff --
What makes it a singleton?..
Nothing stops me from adding a call in main():
`AsyncFunction<Integer, String> function2 = new
SampleAsyncFunction(sleepFactor2, failRatio2, shutdownWaitTS2);`
IMHO, we need to put back "static" on executorService and random. And add
"static" to counter.
---