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 A91D1200B74 for ; Thu, 1 Sep 2016 18:49:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A795D160AB5; Thu, 1 Sep 2016 16:49: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 C9DF0160AA8 for ; Thu, 1 Sep 2016 18:49:06 +0200 (CEST) Received: (qmail 86543 invoked by uid 500); 1 Sep 2016 16:49:06 -0000 Mailing-List: contact users-help@apex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@apex.apache.org Delivered-To: mailing list users@apex.apache.org Received: (qmail 86530 invoked by uid 99); 1 Sep 2016 16:49:06 -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; Thu, 01 Sep 2016 16:49:06 +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 9370018A135 for ; Thu, 1 Sep 2016 16:49:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.721 X-Spam-Level: X-Spam-Status: No, score=-0.721 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=datatorrent-com.20150623.gappssmtp.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id wuYx0reDvZfA for ; Thu, 1 Sep 2016 16:49:02 +0000 (UTC) Received: from mail-qt0-f177.google.com (mail-qt0-f177.google.com [209.85.216.177]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 34D225F1EB for ; Thu, 1 Sep 2016 16:49:02 +0000 (UTC) Received: by mail-qt0-f177.google.com with SMTP id 11so32484270qtc.0 for ; Thu, 01 Sep 2016 09:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datatorrent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=qfqWebHvBY1MpHnyip1PNRgw1vAWRqsnstrDa6xK2y0=; b=YxQCXjNYigcLDtXps4zPVq0fe8I2VsM9bnyfffNB2gl/FhfPx7blO3ngh30shCJzgB /YsZ0Gu+6YrOgkxVgNCiGDQayIdo4nuxoQlfZ6TOGc3Mq6Y2PDg/seFqsYzYHafe339Q bKD9MDPE7a0l/gmG3rQ9R3G72gkqZ2OLOcJ2h88S1QiCmwYRBjc8Q5coIIymDdbmn7y8 4dmHoM5k+naUfpsqfIFlunVFU+dAwC/MD8DBXtQBmXJEiEwQxeyTIJssje/XlAid/8UA OVigvZHwHXjP4FIWpVRAHkLKqntPUp9d7lUiZ9UsHfOhoIwkuJSR239EMgS0yIssrkEX d+Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=qfqWebHvBY1MpHnyip1PNRgw1vAWRqsnstrDa6xK2y0=; b=hxgVo+pdd87vDSMl7Ay63xalwX3r5GmV9cU5Z6cI1nzOcCYgvR9fElL1uhgX3m6HpF pJueB8ZSDeuer5m9cpTmySDXFXwGgwY0JPQ0bI+a/eEjErcWtMqKAoh7HvKQze37HSiv oFpiAiOkK7Aj/V5fPGqfoWyp1Q3yQUr+WaJgZrwa3tqlTquyg6PEzKz6j/fyVvj8W+Fb hbWFl1SkdtJzxl6Dg7A51I2rJ7LMhI7NEDMhMH+lM2/g39Gp5gUF4Xs4HybKc3HQ/WJn 71XEykdSxMaI+g2LApH8GTiPdfLGVL80qy4mQghCw9OEwpolylTlAqdNUH91/DPue7Sq VvHQ== X-Gm-Message-State: AE9vXwO7Cxy0aa1gt/YkqARX7cEQfesmvfelNKgG/Np2nGDyGK9TLdy/uS9KtmPCgIbcX4DQ8yjuDp57RBX2Qzx2 X-Received: by 10.237.59.212 with SMTP id s20mr18662366qte.126.1472748541585; Thu, 01 Sep 2016 09:49:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.44.230 with HTTP; Thu, 1 Sep 2016 09:49:01 -0700 (PDT) In-Reply-To: References: From: Tushar Gosavi Date: Thu, 1 Sep 2016 22:19:01 +0530 Message-ID: Subject: Re: HDHT question - looking for the datatorrent gurus! To: users@apex.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable archived-at: Thu, 01 Sep 2016 16:49:07 -0000 Hi Jim, Currently HDHT is accessible only to single operator in a DAG. Single HDHT store can not be managed by two different operator at a time which could cause metadata corruption. Theoretically HDHT bucket could be read from multiple operators, but only one writer is allowed. In your case a stage in transaction is processed completely by different operator and then only next stage can start. It could still be achieved by using a single operator which manages HDHT state, and having a loop in DAG to send completed transaction ids to sequencer. - Sequence operator will emit transaction to transaction processing operato= r. - If it receives an out of order transaction it will note it down in HDHT. - The processing operator will send completed transaction id on a port which is connected back to sequence operator. - On receiving data on this loopback port, sequence operator will update HDHT and search for next transaction in order, which could be stored in HDHT and will emit to next processing operator. - Tushar. On Sat, Aug 27, 2016 at 1:31 AM, Jim wrote: > Good afternoon, > > > > I have an apex application where I may receive edi transactions, but > sometimes they arrive out of order and I want to hold any out of sequence > transactions till the correct time in the flow to process them. > > > > For example for a standard order, we will receive from the remote vendor: > > > > 1.) General Acknowledgement > > 2.) Detailed Acknowledgement > > 3.) Ship Notification > > 4.) Invoice > > > > They are supposed to be sent and received in that order. > > > > However sometimes vendors systems have problems, etc. so they send the al= l > of these at the same time, and then we can receive them out of sequence. > Data packets for these are very small, say from 1 to 512 bytes, and the o= nly > time they will be out of sequence, we will receive them very closely > together. > > > > I am trying to think of the best way to do this in my datatorrent / Hadoo= p / > yarn facilities, instead of creating a datatable in postgreSQl and using > that. > > > > Can I create a flow that works like this (I am not sure if this makes sen= se, > or is the best way to solve my problem, while keeping state, etc. maintai= ned > for all the operators): > > > > 1.) In the inbound transaction router, check the hdht store for the or= der > number, if it doesn=E2=80=99t exist, this means it is a new order, if the > transaction trying to process is the general acknowledgment, emit the dat= a > to the general acknowledgement operator; if it is not =E2=80=93 store the > transaction data into the correct bucket identifying the transaction is i= t > for, as well as the next step to be the general acknowledgement in HDHT b= y > order number. > > 2.) Say the next transaction is the ship notification, in the router, = we > would check the HDHT store, see this is not the next expected transaction > (say it is supposed to be the detail acknowledgement), so we would just p= ost > the data for the ship notification into HDHT the store and say we are don= e. > > 3.) Say we now receive the detailed acknowledgement for an order whose > next step IS the detailed acknowledgement, we would see this is the corre= ct > next transaction, emit it to the detailed acknowledgement operator, and > update the HDHT store to show that the next transaction should be the shi= p > notification. NOTE: we can=E2=80=99t emit the ship notification yet, ti= ll we have > confirmed that the detailed ackkowledgment has been completed. > > 4.) In each of the 4 transaction operators at the end of the processin= g, > we would update the HDHT store to show the next expected step, and if we > already received data for the next expected step pull it from the HDHT > store, and write the transaction into our SQS queue which is the input in= to > the inbound transaction router at the beginning of the application, so it > processes through the system. > > > > I believe HDHT can be used to pass data throughout an entire application, > and is not limited to just a per operator basis, correct? > > > > Any comments / feedback? > > > > Thanks, > > > > Jim