From hdfs-issues-return-253134-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Mon Feb 25 23:11:05 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C2819180626 for ; Tue, 26 Feb 2019 00:11:04 +0100 (CET) Received: (qmail 56867 invoked by uid 500); 25 Feb 2019 23:11:03 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 56850 invoked by uid 99); 25 Feb 2019 23:11:03 -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; Mon, 25 Feb 2019 23:11:03 +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 08BE818191A for ; Mon, 25 Feb 2019 23:11:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.001 X-Spam-Level: X-Spam-Status: No, score=-109.001 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id NR24tckuvyao for ; Mon, 25 Feb 2019 23:11:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 052835FD97 for ; Mon, 25 Feb 2019 23:11:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 86A05E27E0 for ; Mon, 25 Feb 2019 23:11:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3C47A24559 for ; Mon, 25 Feb 2019 23:11:00 +0000 (UTC) Date: Mon, 25 Feb 2019 23:11:00 +0000 (UTC) From: "Todd Lipcon (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-14111) hdfsOpenFile on HDFS causes unnecessary IO from file offset 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-14111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16777375#comment-16777375 ] Todd Lipcon commented on HDFS-14111: ------------------------------------ {quote} jthr = newJavaStr(env, "in:readbytebuffer", &jCapabilityString); jthr = invokeMethod(env, &jVal, INSTANCE, jFile, HADOOP_ISTRM, "hasCapability", "(Ljava/lang/String;)Z", jCapabilityString); {quote} We probably need to check 'jthr' from the newJavaStr before moving along to invokeMethod, even though it's highly unlikely to hit an issue. (it could OOM) Otherwise I think this makes sense. [~stevel@apache.org] does the StreamCapabiltiies change look good to you? > hdfsOpenFile on HDFS causes unnecessary IO from file offset 0 > ------------------------------------------------------------- > > Key: HDFS-14111 > URL: https://issues.apache.org/jira/browse/HDFS-14111 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client, libhdfs > Affects Versions: 3.2.0 > Reporter: Todd Lipcon > Assignee: Sahil Takiar > Priority: Major > Attachments: HDFS-14111.001.patch, HDFS-14111.002.patch > > > hdfsOpenFile() calls readDirect() with a 0-length argument in order to check whether the underlying stream supports bytebuffer reads. With DFSInputStream, the read(0) isn't short circuited, and results in the DFSClient opening a block reader. In the case of a remote block, the block reader will actually issue a read of the whole block, causing the datanode to perform unnecessary IO and network transfers in order to fill up the client's TCP buffers. This causes performance degradation. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org