Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5B79C10F9C for ; Thu, 8 Aug 2013 11:53:41 +0000 (UTC) Received: (qmail 31076 invoked by uid 500); 8 Aug 2013 11:53:36 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 30868 invoked by uid 500); 8 Aug 2013 11:53:36 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 30861 invoked by uid 99); 8 Aug 2013 11:53:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Aug 2013 11:53:36 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jayunit100@gmail.com designates 209.85.223.175 as permitted sender) Received: from [209.85.223.175] (HELO mail-ie0-f175.google.com) (209.85.223.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Aug 2013 11:53:31 +0000 Received: by mail-ie0-f175.google.com with SMTP id s9so1618800iec.34 for ; Thu, 08 Aug 2013 04:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=ma/+G7fBsGXLtSkb79dsDykyOaECCzyvjhpDCe9+FU8=; b=lusIeZVJUdWDb9gPGvXbVZBAWvC8L4L5w6ZTgMvcL2qToZRifDOkM4HofNCVe7BLXP rdFaNZey9yvOsi1ALuXuXY2UIMM0sJQKfBmji9Qd7gb1s/ceLuxILrkTTtmFmxrUawio wk/o5U10+m87W4q7eoPnw5hC4QhvZBdrEqA3y6AHnTtFn93EZrtlBtdoALFNJU1vy+DP LvaMyYDcTgNGf7Jh9jUPTWgHfHdUlUtV3BbN3tAYyEnAFsj3fWqhEGDbsLu/Yq9Kcl0/ t6t6IMtjn2eudWlljDus7dPiOvMK9v51Z7WRF9Hk2+vdGmdYSxY2CngBE1dRUJFOJZPZ 2www== X-Received: by 10.43.11.69 with SMTP id pd5mr1941233icb.62.1375962791016; Thu, 08 Aug 2013 04:53:11 -0700 (PDT) Received: from [10.174.89.216] (mobile-198-228-198-155.mycingular.net. [198.228.198.155]) by mx.google.com with ESMTPSA id jg5sm6278313igb.0.2013.08.08.04.53.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 04:53:10 -0700 (PDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-33F8C5CB-DF31-4D1B-960B-9DD25F79E658 Content-Transfer-Encoding: 7bit Message-Id: Cc: "" X-Mailer: iPhone Mail (10B350) From: Jay Vyas Subject: Re: Why LineRecordWriter.write(..) is synchronized Date: Thu, 8 Aug 2013 07:53:07 -0400 To: "user@hadoop.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-33F8C5CB-DF31-4D1B-960B-9DD25F79E658 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Then is this a bug? Synchronization in absence of any race condition is nor= mally considered "bad". In any case id like to know why this writer is synchronized whereas the othe= r one are not.. That is, I think, then point at issue: either other writers s= hould be synchronized or else this one shouldn't be - consistency across the= write implementations is probably desirable so that changes to output forma= ts or record writers don't lead to bugs in multithreaded environments . On Aug 8, 2013, at 6:50 AM, Harsh J wrote: > While we don't fork by default, we do provide a MultithreadedMapper implem= entation that would require such synchronization. But if you are asking is i= t necessary, then perhaps the answer is no. >=20 > On Aug 8, 2013 3:43 PM, "Azuryy Yu" wrote: >> its not hadoop forked threads, we may create a line record writer, then c= all this writer concurrently. >>=20 >> On Aug 8, 2013 4:00 PM, "Sathwik B P" wrote: >>> Hi, >>> Thanks for your reply. >>> May I know where does hadoop fork multiple threads to use a single Recor= dWriter. >>>=20 >>> regards, >>> sathwik >>>=20 >>> On Thu, Aug 8, 2013 at 7:06 AM, Azuryy Yu wrote: >>>> because we may use multi-threads to write a single file. >>>>=20 >>>> On Aug 8, 2013 2:54 PM, "Sathwik B P" wrote: >>>>> Hi, >>>>>=20 >>>>> LineRecordWriter.write(..) is synchronized. I did not find any other R= ecordWriter implementations define the write as synchronized. >>>>> Any specific reason for this. >>>>>=20 >>>>> regards, >>>>> sathwik --Apple-Mail-33F8C5CB-DF31-4D1B-960B-9DD25F79E658 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Then is this a bug?  Synchronization in absence of any race condition is normally considered "bad".

In any case id like to know why this writer is synchronized whereas the other one are not.. That is, I think, then point at issue: either other writers should be synchronized or else this one shouldn't be - consistency across the write implementations is probably desirable so that changes to output formats or record writers don't lead to bugs in multithreaded environments .

On Aug 8, 2013, at 6:50 AM, Harsh J <harsh@cloudera.com> wrote:

While we don't fork by default, we do provide a MultithreadedMapper implementation that would require such synchronization. But if you are asking is it necessary, then perhaps the answer is no.

On Aug 8, 2013 3:43 PM, "Azuryy Yu" <azuryyyu@gmail.com> wrote:

its not hadoop forked threads, we may create a line record writer, then call this writer concurrently.

On Aug 8, 2013 4:00 PM, "Sathwik B P" <sathwik.bp@gmail.com> wrote:
Hi,
Thanks for your reply.
May I know where does hadoop fork multiple threads to use a single RecordWriter.

regards,
sathwik

On Thu, Aug 8, 2013 at 7:06 AM, Azuryy Yu <azuryyyu@gmail.com> wrote:

because we may use multi-threads to write a single file.

On Aug 8, 2013 2:54 PM, "Sathwik B P" <sathwik@apache.org> wrote:
Hi,

LineRecordWriter.write(..) is synchronized. I did not find any other RecordWriter implementations define the write as synchronized.
Any specific reason for this.

regards,
sathwik

--Apple-Mail-33F8C5CB-DF31-4D1B-960B-9DD25F79E658--