edgent-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddebrunner <...@git.apache.org>
Subject [GitHub] incubator-quarks pull request: [QUARKS-124] [REVIEW] add Deadtime ...
Date Tue, 19 Apr 2016 23:16:29 GMT
Github user ddebrunner commented on a diff in the pull request:

    https://github.com/apache/incubator-quarks/pull/91#discussion_r60328538
  
    --- Diff: analytics/sensors/src/main/java/quarks/analytics/sensors/Deadtime.java ---
    @@ -0,0 +1,98 @@
    +package quarks.analytics.sensors;
    +
    +import java.util.Date;
    +import java.util.Objects;
    +import java.util.concurrent.TimeUnit;
    +
    +import quarks.function.Predicate;
    +
    +/**
    + * A generic "deadtime" {@link Predicate}.
    + * <p>
    + * After accepting a tuple ({@link #test(Object) test()} returns true),
    + * any tuples received during the "deadtime" period are rejected
    + * ({@link #test(Object) test()} returns false).
    + * Then the next tuple is accepted and a new deadtime period begun.
    + * </p><p>
    + * The deadtime period may be changed while the topology is running
    + * via {@link #setPeriod(long, TimeUnit)}.
    + * </p>
    + *
    + * @param <T> tuple type
    + */
    +public class Deadtime<T> implements Predicate<T> {
    +    private static final long serialVersionUID = 1L;
    +    private transient long deadtimePeriod;
    +    private transient TimeUnit deadtimeUnit;
    +    private transient long deadtimePeriodMillis;
    --- End diff --
    
    the same info is being stored twice, it seems to be only for the toString() method, is
it worth it?


---
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