Return-Path: X-Original-To: apmail-asterixdb-dev-archive@minotaur.apache.org Delivered-To: apmail-asterixdb-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1B3E718AC3 for ; Thu, 10 Dec 2015 16:33:00 +0000 (UTC) Received: (qmail 45437 invoked by uid 500); 10 Dec 2015 16:32:59 -0000 Delivered-To: apmail-asterixdb-dev-archive@asterixdb.apache.org Received: (qmail 45386 invoked by uid 500); 10 Dec 2015 16:32:59 -0000 Mailing-List: contact dev-help@asterixdb.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.incubator.apache.org Delivered-To: mailing list dev@asterixdb.incubator.apache.org Received: (qmail 45374 invoked by uid 99); 10 Dec 2015 16:32:59 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Dec 2015 16:32:59 +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 243E71A5B18 for ; Thu, 10 Dec 2015 16:32:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id EbmTIFoKEHR4 for ; Thu, 10 Dec 2015 16:32:47 +0000 (UTC) Received: from mail-vk0-f45.google.com (mail-vk0-f45.google.com [209.85.213.45]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id E0A6C265D8 for ; Thu, 10 Dec 2015 16:32:46 +0000 (UTC) Received: by vkha189 with SMTP id a189so89865085vkh.2 for ; Thu, 10 Dec 2015 08:32:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=JaVvKZGzfyJWLxPluf0vf0Xu9z+ZnueHN1AICgQWx/0=; b=gkNMUOvNq2/VEJ3O2qigAEcRx0RCfAoYVOVmivHOh5uwmFT41VkV0/F3eyM8qRPUEL ZU4QwIuxS9ZSWoMUiKjayb6b33gE4a8NczIIBloidu3EdEq8ofpWlL+Bicg6uCFYP03z ZFkxZN/ZPc32IE87X+atJcdMpIhoETft0Hd+rFiSbfudvRsbp4g0ScEhC62vs1VFq6YM 3U8xS0Ddg/cMTnE3TRy/LGaBot9n8bcMPnD5lvpbcNS24yS6rPSOxjE+1umKzal1usMi vtEFPV42l2mcChFXVUhwQQ72B8XbgBniDXqHMp16tG2VxbHBvDkXCxYIxX4fdAl49QW8 03NA== MIME-Version: 1.0 X-Received: by 10.13.214.19 with SMTP id y19mr5400651ywd.63.1449765165823; Thu, 10 Dec 2015 08:32:45 -0800 (PST) Received: by 10.37.92.132 with HTTP; Thu, 10 Dec 2015 08:32:45 -0800 (PST) In-Reply-To: References: <5667DEAC.1040309@gmail.com> <69E10FC8-6E3E-4517-BA9E-11D160F5C947@apache.org> Date: Thu, 10 Dec 2015 08:32:45 -0800 Message-ID: Subject: Re: IFramewriter state transitions From: Yingyi Bu To: dev@asterixdb.incubator.apache.org Content-Type: multipart/alternative; boundary=94eb2c076a24b77ee005268dc1fb --94eb2c076a24b77ee005268dc1fb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable There are multiple IFrameWriters created by the IOperatorNodePushable, one for each input. It doesn't violate the contract. Best, Yingyi On Thu, Dec 10, 2015 at 7:55 AM, abdullah alamoudi wrote: > However, > Have a look at UnionAllOperatorDescriptor. For the IFrameWriter created > here, it needs to accept multiple open calls and multiple close calls sin= ce > it has multiple inputs and a single output. > This doesn't conform to the allowed calls as per the contract specified i= n > the document. > > Cheers, > Abdullah. > > Amoudi, Abdullah. > > On Wed, Dec 9, 2015 at 11:52 AM, abdullah alamoudi > wrote: > > > I think you're right. > > > > Cheers, > > Abdullah. > > > > Amoudi, Abdullah. > > > > On Wed, Dec 9, 2015 at 11:48 AM, Till Westmann wrote= : > > > >> I think that the state diagram says that it=E2=80=99s not allowed. > >> However, I don=E2=80=99t think that each implementation should check t= hat, as > >> that would require additional state and code in each operator that > should > >> not be needed (if everybody sticks to the contract). > >> If we want to check that the contract is maintained we should do that > >> either in the unit tests or by introducing a wrapper that checks the > >> contract on top of the operator itself. This wrapper could then be add= ed > >> during plan generation if indicated by a user (e.g. by setting a flag)= . > >> > >> My 2c, > >> Till > >> > >> On 9 Dec 2015, at 10:56, abdullah alamoudi wrote: > >> > >> There seems to be something missing here which is the legal function > calls > >>> that can be made in each state. For example: > >>> > >>> 1. Is it legal to call open() on an open instance of IFrameWriter? If > >>> not, > >>> then is it the responsibility of the IFrameWriter to throw an excepti= on > >>> in > >>> that case > >>> ? > >>> 2. Is it legal to call close() on a closed instance of IFrameWriter? = If > >>> not, then again, who's responsibility is it to throw an exception in > that > >>> case? > >>> 3. Is it legal to call fail() on a failed instance of IFrameWriter? I= f > >>> not, > >>> then again, who's responsibility is it to throw an exception in that > >>> case? > >>> > >>> I am asking this because I think that is happening in some places in > the > >>> code already. > >>> Should we allow that? > >>> > >>> Abdullah. > >>> > >>> Amoudi, Abdullah. > >>> > >>> On Tue, Dec 8, 2015 at 11:56 PM, Mike Carey wrote= : > >>> > >>> +1 > >>>> > >>>> On 12/8/15 5:43 PM, Till Westmann wrote: > >>>> > >>>> Hi, > >>>>> > >>>>> When improving test coverage we noticed, that there are some > >>>>> inconsistencies wrt. state management and transitions in different > >>>>> implementations of IFramewriter. These inconsistencies cause a numb= er > >>>>> of > >>>>> test failures - especially when testing error conditions. Ian has > >>>>> written > >>>>> up a document [1] on the current contract (which is unfortunately n= ot > >>>>> consistently implemented) and on an alternate contract that we have > >>>>> discussed. > >>>>> We currently believe that the alternate contract would be preferabl= e > as > >>>>> there is more similarity in the approach to handling errors during > >>>>> open() > >>>>> or nextFrame(). > >>>>> Our proposal is to > >>>>> 1) Adopt the alternate contract and document it in > >>>>> a) the IFramewriter javadoc and > >>>>> b) a design document. > >>>>> 2) Implement new operators according to the alternate contract. > >>>>> 3) Add mock-based unit tests (e.g. using Mockito [2]) for new > operators > >>>>> that verify that the contract is maintained. > >>>>> 4) Add mock-based using test for existing operators as bugs are fou= nd > >>>>> and > >>>>> fixed. > >>>>> > >>>>> Please take a look at the document and tell us, what you think abou= t > >>>>> the > >>>>> contract and the approach. > >>>>> > >>>>> Thanks, > >>>>> Abdullah, Ian, Yingyi, and Till > >>>>> > >>>>> [1] > >>>>> > >>>>> > https://docs.google.com/document/d/1QJ8X7QFMMax5D5k9RVje6hoNr_SNZSW9Oshzv= 7DpcQw/edit?usp=3Dsharing > >>>>> [2] http://mockito.org/ > >>>>> > >>>>> > >>>> > >>>> > > > --94eb2c076a24b77ee005268dc1fb--