From issues-return-20418-apmail-nifi-issues-archive=nifi.apache.org@nifi.apache.org Tue Feb 14 20:47:45 2017 Return-Path: X-Original-To: apmail-nifi-issues-archive@minotaur.apache.org Delivered-To: apmail-nifi-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 43C1919304 for ; Tue, 14 Feb 2017 20:47:45 +0000 (UTC) Received: (qmail 34312 invoked by uid 500); 14 Feb 2017 20:47:45 -0000 Delivered-To: apmail-nifi-issues-archive@nifi.apache.org Received: (qmail 34274 invoked by uid 500); 14 Feb 2017 20:47:45 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 34265 invoked by uid 99); 14 Feb 2017 20:47:45 -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, 14 Feb 2017 20:47:45 +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 B982E1A01D9 for ; Tue, 14 Feb 2017 20:47:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.998 X-Spam-Level: X-Spam-Status: No, score=-1.998 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999, URIBL_BLOCKED=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 j-wDpVwaAKFm for ; Tue, 14 Feb 2017 20:47:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id CB7D05FBA1 for ; Tue, 14 Feb 2017 20:47:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 14198E0537 for ; Tue, 14 Feb 2017 20:47:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id BFF902411B for ; Tue, 14 Feb 2017 20:47:41 +0000 (UTC) Date: Tue, 14 Feb 2017 20:47:41 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@nifi.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (NIFI-3034) New Processor to use Counters 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/NIFI-3034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15866635#comment-15866635 ] ASF GitHub Bot commented on NIFI-3034: -------------------------------------- Github user joewitt commented on a diff in the pull request: https://github.com/apache/nifi/pull/1323#discussion_r101139076 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UpdateCounter.java --- @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.processors.standard; + +import org.apache.nifi.annotation.behavior.InputRequirement; +import org.apache.nifi.annotation.behavior.ReadsAttribute; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.flowfile.FlowFile; +import org.apache.nifi.logging.ComponentLog; +import org.apache.nifi.processor.Relationship; +import org.apache.nifi.processor.AbstractProcessor; +import org.apache.nifi.processor.ProcessContext; +import org.apache.nifi.processor.ProcessSession; +import org.apache.nifi.processor.ProcessorInitializationContext; +import org.apache.nifi.processor.exception.ProcessException; +import org.apache.nifi.processor.util.StandardValidators; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.HashSet; + +/** + * Created by onb813 on 11/10/16. + */ + +@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED) +@Tags({"counter","tracking","provenance"}) +@CapabilityDescription("Can update counter value and can get counter value to use") +@ReadsAttribute(attribute = "counterName", description = "The name of the counter to update/get.") +public class UpdateCounter extends AbstractProcessor { + + + + public static final PropertyDescriptor CounterName = new PropertyDescriptor.Builder() + .name("CounterName") + .description("The name of the counter you want to set the value off - supports expression language like ${counterName}") + .required(true) + .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(true) + .build(); + + //TODO Can this support expression language too? --- End diff -- please remove this comment. If additional feature support is needed later a JIRA/pr can be opened for it. > New Processor to use Counters > ----------------------------- > > Key: NIFI-3034 > URL: https://issues.apache.org/jira/browse/NIFI-3034 > Project: Apache NiFi > Issue Type: New Feature > Reporter: Sai Peddy > Priority: Minor > > The processor lets you update counters (increment and decrement) and retrieve counter values as well. To help keep track of data going through the system. This allows for use of counters within the flow - not just API. -- This message was sent by Atlassian JIRA (v6.3.15#6346)