Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-9784

Inconsistent use of 'static' in AsyncIOExample.java

    XMLWordPrintableJSON

Details

    Description

      In SampleAsyncFunction having executorService and random as static, but counter as instance-specific will not work when someone creates a second instance of SampleAsyncFunction. In second SampleAsyncFunction the counter will be 0 and we will re-intialize static executorService and random, thus interfering with the first SampleAsyncFunction object.

      To fix this example and make it clearer, make executorService and random instance-specific. That will make counter redundant; also synchronization on class will no longer be needed.

      Attachments

        Issue Links

          Activity

            People

              nekrassov Alexei Nekrassov
              nekrassov Alexei Nekrassov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: