Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 17152 invoked from network); 28 Sep 2006 22:23:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Sep 2006 22:23:50 -0000 Received: (qmail 52665 invoked by uid 500); 28 Sep 2006 22:23:49 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 52634 invoked by uid 500); 28 Sep 2006 22:23:49 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 52607 invoked by uid 99); 28 Sep 2006 22:23:48 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Sep 2006 15:23:48 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:49780] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 72/F2-00212-37B4C154 for ; Thu, 28 Sep 2006 15:23:47 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4F61B7141F1 for ; Thu, 28 Sep 2006 22:19:51 +0000 (GMT) Message-ID: <8136511.1159481991322.JavaMail.jira@brutus> Date: Thu, 28 Sep 2006 15:19:51 -0700 (PDT) From: "Milind Bhandarkar (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Updated: (HADOOP-519) HDFS File API should be extended to include positional read In-Reply-To: <7528490.1157757622361.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HADOOP-519?page=all ] Milind Bhandarkar updated HADOOP-519: ------------------------------------- Attachment: pread.patch This is the new patch that fixes the problems in earlier patch mentioned by Doug. > HDFS File API should be extended to include positional read > ----------------------------------------------------------- > > Key: HADOOP-519 > URL: http://issues.apache.org/jira/browse/HADOOP-519 > Project: Hadoop > Issue Type: New Feature > Components: dfs > Affects Versions: 0.6.0 > Environment: All > Reporter: Milind Bhandarkar > Assigned To: Milind Bhandarkar > Fix For: 0.7.0 > > Attachments: pread.patch > > > HDFS Input streams should support positional read. Positional read (such as the pread syscall on linux) allows reading for a specified offset without affecting the current file offset. Since the underlying file state is not touched, pread can be used efficiently in multi-threaded programs. > Here is how I plan to implement it. > Provide PositionedReadable interface, with the following methods: > int read(long position, byte[] buffer, int offset, int length); > void readFully(long position, byte[] buffer, int offset, int length); > void readFully(long position, byte[] buffer); > Abstract class FSInputStream would provide default implementation of the above methods using getPos(), seek() and read() methods. The default implementation is inefficient in multi-threaded programs since it locks the object while seeking, reading, and restoring to old state. > DFSClient.DFSInputStream, which extends FSInputStream will provide an efficient non-synchronized implementation for above calls. > In addition, FSDataInputStream, which is a wrapper around FSInputStream, will provide wrapper methods for above read methods as well. > Patch forthcoming early next week. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira