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 EE8DC1755D for ; Tue, 9 Jun 2015 09:59:01 +0000 (UTC) Received: (qmail 1775 invoked by uid 500); 9 Jun 2015 09:59:01 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 1731 invoked by uid 500); 9 Jun 2015 09:59:01 -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 1713 invoked by uid 99); 9 Jun 2015 09:59:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2015 09:59:01 +0000 Date: Tue, 9 Jun 2015 09:59:01 +0000 (UTC) From: "Vinayakumar B (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-7817) RawLocalFileSystem.append() should give FSDataOutputStream with accurate .getPos() 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/HADOOP-7817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14578656#comment-14578656 ] Vinayakumar B commented on HADOOP-7817: --------------------------------------- 4. {{assertEquals(pos, out.getPos());}}, better this be asserted against hardcoded value 4. 5. {code}+ StringBuffer buff = new StringBuffer(); + FSDataInputStream in = fs.open(path1); + int c; + while ((c = in.read()) != -1) { + buff.append((char) c); + } + + //Verify the content + assertEquals("text1 text2", buff.toString());{code} Above one could be also written as {code} FSDataInputStream in = fs.open(path1); byte[] buf = new byte[in.available()]; in.read(buf); // Verify the content assertEquals("text1 text2", new String(buf));{code} > RawLocalFileSystem.append() should give FSDataOutputStream with accurate .getPos() > ---------------------------------------------------------------------------------- > > Key: HADOOP-7817 > URL: https://issues.apache.org/jira/browse/HADOOP-7817 > Project: Hadoop Common > Issue Type: Bug > Components: fs > Affects Versions: 1.0.0 > Reporter: Kristofer Tomasette > Assignee: kanaka kumar avvaru > Priority: Minor > Attachments: HADOOP-7817-01.patch, HADOOP-7817.patch > > Original Estimate: 1h > Remaining Estimate: 1h > > When RawLocalFileSyste.append() is called it returns an FSDataOutputStream whose .getPos() returns 0. > getPos() should return position in the file where appends will start writing. -- This message was sent by Atlassian JIRA (v6.3.4#6332)