Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 451A5200CD0 for ; Tue, 11 Jul 2017 04:59:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4392C164F5B; Tue, 11 Jul 2017 02:59:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 61C72164F59 for ; Tue, 11 Jul 2017 04:59:06 +0200 (CEST) Received: (qmail 52901 invoked by uid 500); 11 Jul 2017 02:59:05 -0000 Mailing-List: contact dev-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 dev@nifi.apache.org Received: (qmail 52870 invoked by uid 99); 11 Jul 2017 02:59:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2017 02:59:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4CDB2194FBA for ; Tue, 11 Jul 2017 02:59:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.396 X-Spam-Level: X-Spam-Status: No, score=-2.396 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id RRccDww9Id8p for ; Tue, 11 Jul 2017 02:59:02 +0000 (UTC) Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 4F5F462C5F for ; Tue, 11 Jul 2017 02:50:28 +0000 (UTC) Received: by mail-wr0-f175.google.com with SMTP id 77so163478643wrb.1 for ; Mon, 10 Jul 2017 19:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=Oso7vA0HmZkYO0Pkcp/H5ChWfVygbpa2JW+as2CxAPk=; b=YG+R8bN9yYWeOwTDZlm0NescTCkzwNsZhmjG27jjA4RODxh4BwmIArGsfzgDMu9zGk yUY26jdeSW4pKMFAjJQSqRF6bXUEqzmz4Qs+GDUtdb/HAdO55LJiSW4jbtRWOPnZ2Vhj 1p3tLn8IpfkqMkMbxP3DvqDcdvQ5uQ8/empkp/nhbkNSiZf+NXkOkXopMaKpuQJCcU7O fsqq46pNPvPigxOgTLOUr0mRE5kN9xL7f472Mw3Q0gFDPgeUe4fEUZEvzfPE04UvFyz9 kep35kRAI6d5wNT8A1yYEWsMF1/okcNj7hJciCF2i+1Nim9P3kD2VaF04zVhCxe+/phI eRQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=Oso7vA0HmZkYO0Pkcp/H5ChWfVygbpa2JW+as2CxAPk=; b=ChFogiyHP50OhuMOdo5RCHPJ00Oh67yfJRCRK9qvFIYYQRfTZT4T2ev+ESvg0ikAWQ A3T73gmRu+vhiq6ICYhph9VfZNVTTVuoNgTDxxODYxo5qMx9HGmX/ubPbh58DR22WcLr aHqTu+zrmQrKIw2xgNSbuajzDkmTwIYPA3C2WEMutRXdgfoMaLpltpQe4CstYTMIiY8w BYBlFNnF8DRd4u6nw+kzmQrWElNLcOz03u82k/Mcf6Z+XYfMkN2JtoGhkITE0IYgjjH4 3LBj0vtXV7w9X4p30odkyLciWD2EHQ8in3nbjWSOsx1C8PrvQyBcmBHk4S1NY8RJbXAw 1Ecw== X-Gm-Message-State: AIVw112svOy/fu3UKL0fXq/b6bnky/OJKqu8aRlDAasg3r1bUq4/BTV2 6gY16EA12xYr0qCjwpGaUcKvEUQBOft8XRw= X-Received: by 10.223.157.35 with SMTP id k35mr8341898wre.156.1499741427833; Mon, 10 Jul 2017 19:50:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.168.108 with HTTP; Mon, 10 Jul 2017 19:50:27 -0700 (PDT) In-Reply-To: References: From: Koji Kawamura Date: Tue, 11 Jul 2017 11:50:27 +0900 Message-ID: Subject: Re: FlowFile position when transferred to Relationship.SELF To: dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable archived-at: Tue, 11 Jul 2017 02:59:07 -0000 Hi Ben, FIFO prioritizer uses lastQueueDate, and when a FlowFile is transferred to SELF, lastQueueDate will be updated, so I think FIFO may not work as you expect. https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-= bundle/nifi-framework/nifi-standard-prioritizers/src/main/java/org/apache/n= ifi/prioritizer/FirstInFirstOutPrioritizer.java#L34 Probably OldestFlowFileFirstPrioritizer is more appropriate for your case. https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-= bundle/nifi-framework/nifi-standard-prioritizers/src/main/java/org/apache/n= ifi/prioritizer/OldestFlowFileFirstPrioritizer.java Thanks, Koji On Mon, Jul 10, 2017 at 10:38 PM, =E5=B0=B9=E6=96=87=E6=89=8D wrote: > Hi Koji, thanks for the explanation, I checked the NIFI documentation you > provided, do you mean I should use the FIFO prioritizer in my case? Becau= se > as you mentioned the FlowFiles would be put back into their original > positions, so as I understand using FIFO should make the FlowFiles in > consistent order. > > Regards, > Ben > > 2017-07-10 17:06 GMT+08:00 Koji Kawamura : > >> Hi, >> >> I think it puts back a FlowFile to its original position but update >> queued date as implemented here: >> https://github.com/apache/nifi/blob/master/nifi-nar- >> bundles/nifi-framework-bundle/nifi-framework/nifi-framework- >> core/src/main/java/org/apache/nifi/controller/repository/ >> StandardProcessSession.java#L1851 >> >> In order to pull FlowFiles from a queue in consistent order, you need >> to specify a prioritizer. >> https://nifi.apache.org/docs/nifi-docs/html/user-guide.html#prioritizati= on >> >> I'm just curious about the functionality you added. Wait processor has >> 'Releasable FlowFile Count' and it could be used to make a batch of >> FlowFiles wait and go. Or Notify's 'Signal Counter Delta' could be >> useful, too. >> >> Regards, >> Koji >> >> On Mon, Jul 10, 2017 at 4:43 PM, =E5=B0=B9=E6=96=87=E6=89=8D wrote: >> > Hi guys, I have written a customized processor whose functionality is >> > similar to the NIFI's Wait processor, the difference is my processor >> needs >> > to wait a batch of data and when the batch end flag is found, it will >> > transfer the batch of data to destinations. >> > >> > I checked the source code of Wait processor and also transferred the >> > flowfiles to Relationship.SELF which is the incoming queue when the ba= tch >> > of data is not yet complete. The problem I found was sometimes I could >> see >> > the sequence of the FlowFiles transferred from my processor to >> destinations >> > were not in order. >> > I then added sequence attribute(number starting from 1) to all FlowFil= es >> > coming into my processor and I could verify that this problem happen f= rom >> > time to time, but I couldn't find the stable way to reproduce it. >> > >> > My question is how does NIFI handle the FlowFile when it's being >> > transferred to Relationship.SELF, does it put back to its original >> position >> > in the incoming queue? Thanks. >> > >> > Regards, >> > Ben >>