Return-Path: X-Original-To: apmail-quarks-dev-archive@minotaur.apache.org Delivered-To: apmail-quarks-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 174941979E for ; Tue, 19 Apr 2016 18:04:30 +0000 (UTC) Received: (qmail 14437 invoked by uid 500); 19 Apr 2016 18:04:30 -0000 Delivered-To: apmail-quarks-dev-archive@quarks.apache.org Received: (qmail 14409 invoked by uid 500); 19 Apr 2016 18:04:29 -0000 Mailing-List: contact dev-help@quarks.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@quarks.incubator.apache.org Delivered-To: mailing list dev@quarks.incubator.apache.org Received: (qmail 14395 invoked by uid 99); 19 Apr 2016 18:04:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Apr 2016 18:04:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 35BD91A0916 for ; Tue, 19 Apr 2016 18:04:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.021 X-Spam-Level: X-Spam-Status: No, score=-4.021 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id qHr8ZtingRGI for ; Tue, 19 Apr 2016 18:04:28 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 59A795F474 for ; Tue, 19 Apr 2016 18:04:27 +0000 (UTC) Received: (qmail 14131 invoked by uid 99); 19 Apr 2016 18:04:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Apr 2016 18:04:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 734062C14F7 for ; Tue, 19 Apr 2016 18:04:25 +0000 (UTC) Date: Tue, 19 Apr 2016 18:04:25 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@quarks.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (QUARKS-150) add Valve Predicate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 stream = ...; > > Valve 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)