From common-issues-return-106857-apmail-hadoop-common-issues-archive=hadoop.apache.org@hadoop.apache.org Fri Apr 8 15:43:26 2016 Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9581A19B7D for ; Fri, 8 Apr 2016 15:43:26 +0000 (UTC) Received: (qmail 50203 invoked by uid 500); 8 Apr 2016 15:43:26 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 50108 invoked by uid 500); 8 Apr 2016 15:43:26 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 50060 invoked by uid 99); 8 Apr 2016 15:43:26 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2016 15:43:26 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CDE7B2C1F64 for ; Fri, 8 Apr 2016 15:43:25 +0000 (UTC) Date: Fri, 8 Apr 2016 15:43:25 +0000 (UTC) From: "Steve Loughran (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-12444) Consider implementing lazy seek in S3AInputStream MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-12444?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Steve Loughran updated HADOOP-12444: ------------------------------------ Attachment: HADOOP-12444-007.patch This is patch 007, which is patch 006 applied to the latest (006) patch of = the positioned readable tests. h3. in {{read(byte[] buf, int off, int len)}} * when reading a len=3D=3D0 from a zero byte file at offset 0, then return = value must be zero * the position update code had been pulled into the try/catch clause; the p= os counters would have become invalid if an exception was raised and the re= -open and read() worked h3. other # use multiple catch to catch the socket and socket timeout exceptions; sim= pler codepath. # in the refactored {{closeStream()}} operation, implemented HADOOP-11874: = if an IOE is thrown in {{wrappedStream.close()}} it's caught, the operatio= n converted to an abort(). As well as all the tests passing, I spent time reviewing the exception hand= ling code, to see if a problem was lurking which tests weren't catching. Re= member: object stores are often used long-haul, so do fail =E2=80=94recover= ability matters. I'm happy with the code as it is now: LGTM > Consider implementing lazy seek in S3AInputStream > ------------------------------------------------- > > Key: HADOOP-12444 > URL: https://issues.apache.org/jira/browse/HADOOP-12444 > Project: Hadoop Common > Issue Type: Sub-task > Components: fs/s3 > Affects Versions: 2.7.1 > Reporter: Rajesh Balamohan > Assignee: Rajesh Balamohan > Attachments: HADOOP-12444-004.patch, HADOOP-12444-005.patch, HADO= OP-12444-006.patch, HADOOP-12444-007.patch, HADOOP-12444.1.patch, HADOOP-12= 444.2.patch, HADOOP-12444.3.patch, HADOOP-12444.WIP.patch, hadoop-aws-test-= reports.tar.gz > > > - Currently, "read(long position, byte[] buffer, int offset, int length)"= is not implemented in S3AInputStream (unlike DFSInputStream). So, "readFul= ly(long position, byte[] buffer, int offset, int length)" in S3AInputStream= goes through the default implementation of seek(), read(), seek() in FSInp= utStream.=20 > - However, seek() in S3AInputStream involves re-opening of connection to = S3 everytime (https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hado= op-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInputStream.java#L115). = =20 > - It would be good to consider having a lazy seek implementation to reduc= e connection overheads to S3. (e.g Presto implements lazy seek. https://git= hub.com/facebook/presto/blob/master/presto-hive/src/main/java/com/facebook/= presto/hive/PrestoS3FileSystem.java#L623) -- This message was sent by Atlassian JIRA (v6.3.4#6332)