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 A0A5C200B26 for ; Mon, 27 Jun 2016 11:24:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9F404160A5B; Mon, 27 Jun 2016 09:24:33 +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 E927B160A3C for ; Mon, 27 Jun 2016 11:24:32 +0200 (CEST) Received: (qmail 142 invoked by uid 500); 27 Jun 2016 09:24:32 -0000 Mailing-List: contact dev-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list dev@flink.apache.org Received: (qmail 131 invoked by uid 99); 27 Jun 2016 09:24:32 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jun 2016 09:24:32 +0000 Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 70ABB1A010F for ; Mon, 27 Jun 2016 09:24:31 +0000 (UTC) Received: by mail-lf0-f44.google.com with SMTP id l188so151145623lfe.2 for ; Mon, 27 Jun 2016 02:24:31 -0700 (PDT) X-Gm-Message-State: ALyK8tKr5/wMbMulRgvNoK8GqLSoMmy2Rp1Gvz7XiyzshkKjbTYMX0xBa89HtAPMA8FtYGCu971XMQpWvQ60UA== X-Received: by 10.46.5.208 with SMTP id 199mr4829515ljf.12.1467019469854; Mon, 27 Jun 2016 02:24:29 -0700 (PDT) MIME-Version: 1.0 References: <76a498af-2503-9a70-d511-c7906ebb1d24@rasumi.net> In-Reply-To: <76a498af-2503-9a70-d511-c7906ebb1d24@rasumi.net> From: Aljoscha Krettek Date: Mon, 27 Jun 2016 09:24:19 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: forward() To: Dev Content-Type: multipart/alternative; boundary=001a114a6e9461205005363f162c archived-at: Mon, 27 Jun 2016 09:24:33 -0000 --001a114a6e9461205005363f162c Content-Type: text/plain; charset=UTF-8 Hi, you are right, this seems a bit strange. The reason why this works is that selectChannels of ForwardPartitioner is never called. In StreamingJobGraphGenerator.connect() operators are connected by "physical" edges. If the ForwardPartitioner is set on a stream this will choose the POINTWISE connection pattern, which does local forwarding from partition 1 to 1, 2 to 2, and so on. Only if another partitioner is set will the ALL_TO_ALL pattern be used. In that case selectChannels() of the partitioner is actually called for decision where to send to. Cheers, Aljoscha On Mon, 27 Jun 2016 at 01:57 Marius Melzer wrote: > Hi, > > I was reading a bit of code about partitioning and I have two questions > about the forward() method of DataStream: > > 1) I was before under the impression that forwarding means sending > records between operators with same parallelism always from partition 1 > to 1, 2 to 2 etc. But this doesn't seem the case because > ForwardPartitioner#selectChannels returns new int[] {0} - which is > interestingly the exact same code like GlobalPartitioner. > 2) Why is there a forward()-statement anyways? Isn't this the default > that messages are forwarded between same partitions or am I getting > something completely wrong here? If so, how does it work and what would > be a good use case for the forward() statement? > > Thanks, > Marius > --001a114a6e9461205005363f162c--