Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D9D210B97 for ; Thu, 15 Aug 2013 20:05:46 +0000 (UTC) Received: (qmail 67896 invoked by uid 500); 15 Aug 2013 20:02:51 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 67463 invoked by uid 500); 15 Aug 2013 20:02:14 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 66829 invoked by uid 99); 15 Aug 2013 20:01:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Aug 2013 20:01:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kglover@appnexus.com designates 207.5.72.163 as permitted sender) Received: from [207.5.72.163] (HELO EXHUB016-1.exch016.msoutlookonline.net) (207.5.72.163) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Aug 2013 19:55:56 +0000 Received: from EXVMBX016-5.exch016.msoutlookonline.net ([207.5.72.175]) by EXHUB016-1.exch016.msoutlookonline.net ([207.5.72.163]) with mapi; Thu, 15 Aug 2013 12:55:35 -0700 From: Kristopher Glover To: "dev@hive.apache.org" Date: Thu, 15 Aug 2013 12:55:32 -0700 Subject: Re: threading with hive client Thread-Topic: threading with hive client Thread-Index: Ac6Z8Wet2KS2Z8luRjGhONkeNf0xxA== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.6.130613 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Interesting, I didn't realize that. If that's the case then I suppose it'd be really bad for me to circumvent the lock by reproducing the Driver#run method by calling Driver#compile and Driver#execute directly from within my app.=20 If that is the case why make Driver#compile and Driver#execute public methods? There doesn't seem to be any inheritance that requires them to be public and the fact that they are public opens up a thread safety issue. Thanks, Kris On 8/15/13 1:11 PM, "Brock Noland" wrote: >The hive semantic analyzer is not fully thread safe. We'd like to remove >that lock but it will be a large project. > >Brock > > >On Thu, Aug 15, 2013 at 11:12 AM, Kristopher Glover >wrote: > >> Hi Everyone, >> >> I'm experiencing a threading issue with the Hive client where I want to >> run multiple queries on the same JVM. >> >> The problem I'm having is that org.apache.hadoop.hive.ql.Driver#run >>(line >> 907) has the following few lines of code : >> >> synchronized (compileMonitor) { >> >> ret =3D compile(command); >> >> } >> >> >> The compileMonitor is a static so it blocks all threads even though I'm >> using different instances of the Driver class. I could explicitly call >> Driver#compile then Driver#execute to avoid the synchronized block but I >> don't know if it's serving a special purpose. Does anyone know why that >> synchronized block is there and if its really necessary ? >> >> >> Thanks, >> >> Kris >> > > > >--=20 >Apache MRUnit - Unit testing MapReduce - http://mrunit.apache.org