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 0A3B9200BF1 for ; Tue, 3 Jan 2017 18:48:02 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 08D88160B43; Tue, 3 Jan 2017 17:48:02 +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 2D2A2160B20 for ; Tue, 3 Jan 2017 18:48:01 +0100 (CET) Received: (qmail 83428 invoked by uid 500); 3 Jan 2017 17:47:58 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 83355 invoked by uid 99); 3 Jan 2017 17:47:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jan 2017 17:47:58 +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 024361A057B for ; Tue, 3 Jan 2017 17:47:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.399 X-Spam-Level: ** X-Spam-Status: No, score=2.399 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_SPAM=0.5, 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-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id cKgUZgdzKUQq for ; Tue, 3 Jan 2017 17:47:55 +0000 (UTC) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 405465FDAE for ; Tue, 3 Jan 2017 17:47:54 +0000 (UTC) Received: by mail-io0-f175.google.com with SMTP id h133so198968108ioe.3 for ; Tue, 03 Jan 2017 09:47:54 -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 :cc; bh=oPOTsrb7B031tusm7G4yQCVPKcSL/kDyKOCLMsp0XIw=; b=h4JSCZU/n++R5JJvEpCD258A50vZDkGz/bDpjEvhFNxjJj6hmrnl1TxqLruCXP8Esa xL7DUpIvPnSpx83Jf3GGADxcdFLnXugF1kJSxMjuiPkYyTw7Jk6Bi9a/IemeAJ9osMb5 CWOdDzN613/nGoHEpAbFB3rZ6v6gW+IkqK1a1L2J4GrzeyC6Fl5+W8wfSJmKh490DcHO Q4qQ8pMEeWymcVBsWOcDnvoae5U04IN4cpMiKtKsVrVZWdX7jFDjj31PiYgfBWdT6Eub gsGaS5R31im5qdP2xuepr4XTyZfp9RrYAeettLQ/DaF6AE2A8sRY6tHLIn8TR15DR/cW Cg8w== 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:cc; bh=oPOTsrb7B031tusm7G4yQCVPKcSL/kDyKOCLMsp0XIw=; b=gDJsMdeIGRxBYR/38HM9XBh7dwFv33f8eCFTGO3KzHDlzNvdQk+EYmtLuUQyNJL80z O5o77mC/bbLKxDpWlIJG18ebPyZshCSbAAKmeYAWa2msLhPXYsjBUjAFIJEcEKC27hWw EVlmOE/ZTHKLO1efEZuIK5Tn4YT8I6soqQ5nl44kewoOppTMAlBVrc54VGAgPTdfbeJG 6jb6YjdyTwAmEubkzoV8D7kp0nWN6vydVdMOt9de50v0cIJ8irkilU/6Y2y4gTM07S79 hLz6urtHZWiHdHBJZ/8EJzdOhDEFKM1Wp4kJ80sOhdTX922FjkibYQs5lE6F9V1pL1J1 y/gw== X-Gm-Message-State: AIkVDXJdBZ//lMZ6IY1nzynCKYlDsMnkrfB6rVQSgENRSa8fd24CEB3nbGYlAfEvJ6SsNZ28q9S8xRnOQg+G1Q== X-Received: by 10.107.139.74 with SMTP id n71mr54840067iod.166.1483465673183; Tue, 03 Jan 2017 09:47:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.47.80 with HTTP; Tue, 3 Jan 2017 09:47:52 -0800 (PST) In-Reply-To: References: From: Manjunath A Date: Tue, 3 Jan 2017 23:17:52 +0530 Message-ID: Subject: Re: Question regarding streamer thread implementation at DFSOutputStream.java To: wang shu Cc: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=94eb2c05be087c991005453444ca archived-at: Tue, 03 Jan 2017 17:48:02 -0000 --94eb2c05be087c991005453444ca Content-Type: text/plain; charset=UTF-8 Hi Shu, Apologies for dealy in response. Close packet is something which is the last packet of the current block after writing which , the current block is closed and a new pipeline is setup for the next block. Your understanding of the one.isLastPacketInBlock() is correct. Regards, Manjunath On Wed, Dec 14, 2016 at 9:37 PM, wang shu wrote: > Hi all, > > I have a question regarding the streamer thread (Line 382-575) > implementation at DFSOutputStream.java(http://gr > epcode.com/file/repo1.maven.org/maven2/org.apache.hadoop/had > oop-hdfs/2.7.1/org/apache/hadoop/hdfs/DFSOutputStream.java# > DFSOutputStream.DataStreamer.run%28%29). > > > What's the logic of line 468-485 and line 535-548, why it check the packet > is the last one twice and the comments are different, one is " > // wait for all data packets have been successfully acked" and another is > "// wait for the close packet has been acked". What's the close packet? > > My understanding of this is: > If a packet is not the last in block, then the packet is sent directly, > and no need to wait for ACK. > If a packet is the last one, then it will first wait for all previous > packet to be ACKed, and then it will send the last packet in this block( > called close packet, I guess?), and then will need wait the last packet to > be ACKed. > > Thanks a lot for your help. > > > Best, > > Shu > --94eb2c05be087c991005453444ca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Shu,

Apologies for dealy in response= .

Close packet is something which is the last pack= et of the current block after writing which , the current block is closed a= nd a new pipeline is setup for the next block.=C2=A0

Your understanding of the=C2=A0one.isLastPacketInBlock()=C2=A0is correct.

Regards,
Manjunath=

On We= d, Dec 14, 2016 at 9:37 PM, wang shu <uchicagoshuwang@gmail.com> wrote:
Hi all,

=


What's = the logic of line 468-485 and line 535-548, why it check the packet is the = last one twice and the comments are different, one is "//=C2=A0wait=C2=A0for=C2=A0all=C2=A0data=C2=A0packets=C2=A0ha= ve=C2=A0been=C2=A0successfully=C2=A0acked" and another is "= ;//=C2=A0wait=C2=A0for=C2=A0the=C2=A0close=C2=A0pac= ket=C2=A0has=C2=A0been=C2=A0acked".=C2=A0 What's the c= lose packet?

My understanding of this is:
If a packet is not the last in block, then the packet is sent directl= y, and no need to wait for ACK.
If a pac= ket is the last one, then it will first wait for all previous packet to be = ACKed, and then it will send the last packet in this block( called close pa= cket, I guess?), and then will need wait the last packet to be ACKed.
=

Thank= s a lot for your help.


Best,
<= div style=3D"font-size:14px">
Shu

--94eb2c05be087c991005453444ca--