flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ChengXiangLi <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-2533] [core] Gap based random sample op...
Date Wed, 09 Sep 2015 02:48:58 GMT
Github user ChengXiangLi commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1110#discussion_r39002786
  
    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/sampling/PoissonSampler.java
---
    @@ -28,11 +29,16 @@
      *
      * @param <T> The type of sample.
      * @see <a href="https://en.wikipedia.org/wiki/Poisson_distribution">https://en.wikipedia.org/wiki/Poisson_distribution</a>
    + * @see <a href="http://erikerlandson.github.io/blog/2014/09/11/faster-random-samples-with-gap-sampling/">Gap
Sampling</a>
      */
     public class PoissonSampler<T> extends RandomSampler<T> {
     	
     	private PoissonDistribution poissonDistribution;
     	private final double fraction;
    +	private final Random random = new Random();
    --- End diff --
    
    The "random" instance should better to be initialized in constructor method and use the
seed parameter while available.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message