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 33C8B200C32 for ; Thu, 9 Mar 2017 07:54:25 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 324AA160B67; Thu, 9 Mar 2017 06:54:25 +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 7A907160B64 for ; Thu, 9 Mar 2017 07:54:24 +0100 (CET) Received: (qmail 77765 invoked by uid 500); 9 Mar 2017 06:54:23 -0000 Mailing-List: contact dev-help@apex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apex.apache.org Delivered-To: mailing list dev@apex.apache.org Received: (qmail 77753 invoked by uid 99); 9 Mar 2017 06:54:23 -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, 09 Mar 2017 06:54:23 +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 E3210186274 for ; Thu, 9 Mar 2017 06:54:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.63 X-Spam-Level: ** X-Spam-Status: No, score=2.63 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 trGstfGrdDVh for ; Thu, 9 Mar 2017 06:54:20 +0000 (UTC) Received: from mail-ua0-f177.google.com (mail-ua0-f177.google.com [209.85.217.177]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 3A0085FB1E for ; Thu, 9 Mar 2017 06:54:20 +0000 (UTC) Received: by mail-ua0-f177.google.com with SMTP id q7so55556063uaf.2 for ; Wed, 08 Mar 2017 22:54:20 -0800 (PST) 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; bh=nsClaOaoMM1KkNPCmjSRqZ838l590T8ctZE9WdPJfQw=; b=S7rSWeZ9EWYleAr0RQpvq1lwbkQzih67fP3YP/olg01kVMOqegDDFdog0eVK4y+rjH PH7v2y9WNv1dxFPvGbRu7qqCPJH5g5rNhnBKRRqSQPaYR4f/uMLw1RnvFh7y9lKBGCGl oQsqKBl4moLhI8UEtcvSYlVe3A05m5bu1rCxbhgttpJDa64P4Oh0wKoK28peiX5H07Nh MVkhC3HhJFkFNAVxSYhvFcH0mWO/ERPaJB1otM8NKuj8QNwHqVEFp+oR3k/M1vHUVOnh V1M0mzH5ORUmQIXGaqFMX0Sfx4+FjPf42m9U8JdfO9++jBH8+rq800DXa6OU2OeH1vGu ZtiA== 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; bh=nsClaOaoMM1KkNPCmjSRqZ838l590T8ctZE9WdPJfQw=; b=gvaWXMsirceUlnOh8PnF4MhCpcmYLpu5GzvJoof+yc8n7tKlV2Nbx2sO1HpyCgGURk b+mIbJqj0b/5/qjJe6BZobwD79RlyBcc1s8vWDRDqupU/zOmwAz0NgkINbIUbenSlAy1 w4CoC5aBC+avtT9VLwdU7iBKeO1m6Tk2McFAWbhfR2EwaqAodKnD66Ed/eWgx8PqdHpx IIRT4SifiFvY3tS/8GB3NJdt+q02xkxIGR2aDWRsSNTBYy0XjNJvIynwASp88g+lNGBn tusWHu36U5nTk2+X1Dp/Tp749IxtclutZO/pbRmCDhWQ5L7CySOfmwIl9YJt1nua5t9U Wt9w== X-Gm-Message-State: AMke39mmKogsTNbU1mW038BzpMWsq/AG0lNzsTrogBcEGy6eIvW+zQiQRLsbbVmdDwQeaovLEqrCILgeF3UxBA== X-Received: by 10.31.201.66 with SMTP id z63mr5222437vkf.16.1489042458926; Wed, 08 Mar 2017 22:54:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.121.131 with HTTP; Wed, 8 Mar 2017 22:54:18 -0800 (PST) In-Reply-To: References: From: AJAY GUPTA Date: Thu, 9 Mar 2017 12:24:18 +0530 Message-ID: Subject: Re: Sort Accumulation To: dev@apex.apache.org Content-Type: multipart/alternative; boundary=001a114832d6d1e464054a46b69e archived-at: Thu, 09 Mar 2017 06:54:25 -0000 --001a114832d6d1e464054a46b69e Content-Type: text/plain; charset=UTF-8 Hi Bright, I couldnot completely understand the bucketing approach you mentioned. How would we bucket the data considering we have no idea what the data will be? How about using a TreeMultiSet? Thanks, Ajay On Wed, Mar 8, 2017 at 11:24 PM, Bright Chen wrote: > Hi Ajay, > I think sort at getOutput() probably will get this method stuck due to very > high volume of computation. > And as we still need to persistent the data, it will not very helpful to > increase the performance of processing tuple. Probably we can bucket the > data with range of value. Such as following: > - process tuple in one window: sort data of current window in memory > - end window: merge the sorted memory data into buckets. > > thanks > Bright > > On Wed, Mar 8, 2017 at 8:51 AM, AJAY GUPTA wrote: > > > Hi Thomas, > > > > I looked at TopN. The accumulate() of TopN is an O(n*k). Using similar > > approach for Sort will lead to an O(n^2) complexity. > > Since we have to sort all elements, we can do it in a single sort call in > > getOutput(). > > > > > > On Wed, Mar 8, 2017 at 10:09 PM, Thomas Weise wrote: > > > > > Look at the existing topN accumulation. It should be a generalization, > > > where you don't have a limit. > > > > > > > > > On Wed, Mar 8, 2017 at 8:05 AM, AJAY GUPTA > wrote: > > > > > > > Hi, > > > > > > > > I would like to propose the Sort Accumulation. The accumulation will > be > > > > responsible for sorting the input POJO stream. The accumulation will > > > > require a comparator to compare and sort the input tuples. Another > > > boolean > > > > parameter "sortDesc" will be used to decide sorting order. > > > > > > > > Let me know your views. > > > > > > > > Thanks, > > > > Ajay > > > > > > > > > > --001a114832d6d1e464054a46b69e--