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 5E219200B2D for ; Thu, 16 Jun 2016 09:41:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5C9DA160A52; Thu, 16 Jun 2016 07:41:05 +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 7A3CD160A51 for ; Thu, 16 Jun 2016 09:41:04 +0200 (CEST) Received: (qmail 8086 invoked by uid 500); 16 Jun 2016 07:40:58 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 8076 invoked by uid 99); 16 Jun 2016 07:40:58 -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, 16 Jun 2016 07:40:58 +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 1D68218057B for ; Thu, 16 Jun 2016 07:40:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.299 X-Spam-Level: * X-Spam-Status: No, score=1.299 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, MIME_QP_LONG_LINE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled 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 9cZQMrBkdAq8 for ; Thu, 16 Jun 2016 07:40:56 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 8A4E15F232 for ; Thu, 16 Jun 2016 07:40:55 +0000 (UTC) Received: from [10.1.1.207] ([88.217.181.95]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LrePN-1bPvNE0JAr-013MGq for ; Thu, 16 Jun 2016 09:40:49 +0200 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Thu, 16 Jun 2016 09:40:47 +0200 Subject: GPARS.withPool, xml.MarkupBuilder, XmlParser and HTTPBuilder From: Paolo To: Message-ID: Thread-Topic: GPARS.withPool, xml.MarkupBuilder, XmlParser and HTTPBuilder Mime-version: 1.0 Content-type: multipart/alternative; boundary="B_3548914849_655142019" X-Provags-ID: V03:K0:4C67ZdFWn4oxuDCA6xBZdMm5a4TtIzW+81915Qj9g0Rlp2FfB2d qU8hNqU/k4N14w87oONLRYoun5QQ3mx+AUM8dn5Z5lp4V8WpYQn7VRPhu3mM+FiANObe/+R k5qCYNVKRPl/Fe+qa8lSpjVLGAPvcsXz6A1V+VR29YpGyr9+rR5EDLQqaIifnud4HpM1S3K vfSKhtR4NipIEIaoUWmPw== X-UI-Out-Filterresults: notjunk:1;V01:K0:SlGS/n9lnkc=:K+149wTyPgw9QXttD+xXwG PggkV6n0Hk5KeuT8p4qyGyZkkwbUNhVbT92d4mMFg9FoCKvKmPQrsK2eikeorXhOUnOYWj6Qt FbmRdKr+h/HREQ6eQP5MTW/7fyRFDFOGw/qX1DZm4NUGh1ZX90c9pQPHLjEkurUAyowVv9ljt 4NOiEYfyLdHY/fQqp0P9AIOpDANpHyi8xpLo/YoQ25RICUayMpTujbKCMTyX+uITrf6AbkN1n jTQut7IpN5OKzw9QeWNfh9iUFVchxe9hm1k8wp1DBUG0PlGIPaJQYoUsuNCscbKUUE5cxMyY9 ldVlJf5Cls50W79qxCc7V7tIM9L0PMOM7Yzm3fo5imRlAjVI42SA+AUKv2FAlS7BzqYk4QJys NX4r6I9lEugefqvpxVhOUkCsLcQp/Dn+gCM5tOl3vFd8LHicmuUASSJk+MbvvCYLSZThY5tlO nZFc+r+QorY4hCkl/jQo62PZhWJ7xZyu7L1tA2Cw7O/yTLUka94PFOt0OIO80HFqNBV82JjGh n24XbU8cWj6C9KCX4UzvS5l609XFPO3ZsdOafnGTxoNErumwK6nsQBMsIFPTO45hCSwHEz7r8 Do+XsGUd05sGdrrYv9qhbC9K6k/mIB0xGox/KAz7XmUz9w9ORfcPF5jN1IDErinC6BNCDdjBc bN/yG5vHApazi4ZBwDnFeAejPieutQThpQKubBdMAxXTIj7Kugcbg7Cxht6U80K59EOLWP7hD 4FGETL0/YmMU05klcHKD9eTQtxlB2HPah8fQBo8AtMdvNvkJ2eR4IHiUBzUwwKKScD9OB5cdK 9J90RLJjO6fe72XUjLzid8en7o4QQ== archived-at: Thu, 16 Jun 2016 07:41:05 -0000 > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3548914849_655142019 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable Hi all, =20 I am pretty new to Groovy and after playing around for a little while I dec= ided to use Groovy for my next little challenge =E2=80=A6 Basically I want to proc= ess a huge list of files (in parallel) using =C2=A0GPARS.withPool. Each file nee= ds to be =C2=A0parsed and converted into a XML file using MarkupBuilder. After t= he XML file is created I would like to reread it with the XmlParser and uplo= ad the original file and the corresponding XML file to a webservice using HT= TPBuilder. =20 So basically I have a closure called fileworker that will process a file =20 def fileworker =3D { =C2=A0 open file =C2=A0 parse file, adjust some values and create XML file using MarkupBuilder =C2=A0 parse the created XML file using XmlParser =C2=A0 upload file and XML file using HTTPBuilder } =20 and this closure will be used for processing the list in parallel (collectP= arallel) =20 groovyx.gpars.GParsPool.withPool(threads) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 result =3D list.collectParallel fileworker } =20 Due to my missing experiences I am a little concerned about thread safety w= hen GPARS comes into place =E2=80=A6. I have a working implemententation of all st= eps described above to run sequencially =E2=80=A6 but now when deploying GPARS, is= there anything special that needs to be considered concerning the usage of = MarkupBuilder, XmlParser, HTTPBuilder in that closure? I would appreciate if= someone could share his experience and opinion =E2=80=A6 =20 Thanks in advance Paolo --B_3548914849_655142019 Content-type: text/html; charset="UTF-8" Content-transfer-encoding: quoted-printable

Hi all,

 

I am pretty new to Groovy and af= ter playing around for a little while I decided to use Groovy for my next li= ttle challenge … Basically I want to process a huge list of files (in = parallel) using =C2=A0GPARS.withPool. Each file needs to be =C2=A0parsed and convert= ed into a XML file using MarkupBuilder. After the XML file is created I woul= d like to reread it with the XmlParser and upload the original file and the = corresponding XML file to a webservice using HTTPBuilder.<= /p>

 =

So basically I have a closure called fileworker that will process a file<= o:p>

 

def fileworker =3D {

=C2=A0 open file

=C2=A0 parse = file, adjust some values and create XML file using MarkupBuilder<= /span>

=C2=A0 p= arse the created XML file using XmlParser

=C2=A0 upload file and XML file= using HTTPBuilder

}

 

and this closure will be us= ed for processing the list in parallel (collectParallel)

 <= /o:p>

groovyx.gpars.GParsPool.withPool(threads) {

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 result =3D list.collectParallel fileworker

}

 <= /o:p>

Due to my missing experiences I am a little concerned about thread safety = when GPARS comes into place …. I have a working implemententation of a= ll steps described above to run sequencially … but now when deploying = GPARS, is there anything special that needs to be considered concerning the = usage of MarkupBuilder, XmlParser, HTTPBuilder in that closure? I would appr= eciate if someone could share his experience and opinion …<= /span>

 

Thanks in advance

Paolo

<= /html> --B_3548914849_655142019--