You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@edgent.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/04/19 20:04:25 UTC

[jira] [Commented] (QUARKS-150) add Valve Predicate

    [ https://issues.apache.org/jira/browse/QUARKS-150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15248315#comment-15248315 ] 

ASF GitHub Bot commented on QUARKS-150:
---------------------------------------

GitHub user dlaboss opened a pull request:

    https://github.com/apache/incubator-quarks/pull/93

    [QUARKS-150] add Valve Predicate

    Q: quarks.analytics.sensors or quarks.topology.plumbing?
    
    Note: there's no benefit to a Filters.valve(State initialState) because in order for the app to change the state of the valve the app needs to new the Valve itself so that it can eventually do valve.setState(newState).  That could change if Valve supports a control mbean but that's a more general discussion for functions an mbeans.
    
    TODO unit test and recipe

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dlaboss/incubator-quarks quarks-150-addValve

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-quarks/pull/93.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #93
    
----

----


> add Valve Predicate
> -------------------
>
>                 Key: QUARKS-150
>                 URL: https://issues.apache.org/jira/browse/QUARKS-150
>             Project: Quarks
>          Issue Type: New Feature
>            Reporter: Dale LaBossiere
>            Assignee: Dale LaBossiere
>
> A Valve Predicate accepts tuples when its state is {@link State#OPEN}, otherwise it rejects tuples.
> A valve is typically used to dynamically control whether or not
> some downstream tuple processing is enabled.  A decision to change the
> state of the valve may be a result of local analytics or an external
> device command.
> [ fwiw, this is known as a 'Switch' utility operator in IBM Streams ]
> Maybe this belongs in quarks.topology.plumbing/PlumbingStreams, not quarks.analytics.sensors/Filters like Deadband and Deadtime, since there's not really much "analytic" about it?
> E.g., a Valve might be used to control whether or not logging of tuples is enabled.
> ```
> TStream<JsonObject> stream = ...;
>  
> Valve<JsonObject> valve = new Valve<>(Valve.State.CLOSED);
> stream.filter(valve).sink(someTupleLoggingConsumer);
> // from some analytic or device command handler...
>     valve.setState(Valve.State.OPEN);
> ```



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)