Return-Path: X-Original-To: apmail-ant-user-archive@www.apache.org Delivered-To: apmail-ant-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2C3679B16 for ; Tue, 20 Dec 2011 05:31:51 +0000 (UTC) Received: (qmail 63210 invoked by uid 500); 20 Dec 2011 05:31:50 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 63111 invoked by uid 500); 20 Dec 2011 05:31:45 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 79263 invoked by uid 99); 19 Dec 2011 18:26:33 -0000 X-ASF-Spam-Status: No, hits=3.3 required=5.0 tests=HTML_MESSAGE,NO_RDNS_DOTCOM_HELO,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.145.54.171 is neither permitted nor denied by domain of fastier@yahoo-inc.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yahoo-inc.com; s=cobra; t=1324319144; bh=4AhAH6OYM2kh6WHpSn5dN2zSKhEpMTEz4VQvFOc1cSI=; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; b=m7ukYOFPYjdHFDGKO+hhIKVXCvM1fHYmkgVxlX548Hl8nTjcILk3EquhbJPjhUnre OQ9q+ZmQJ6vqF7dh9awSv6SwFNUNrUuHev3Z8LnqR6CJdPUK0OrsBl7Fovy70fsEBa I/YY3Nh1+n0AcID9GpRw17cG6Vm/U8wMoJ24Ft14= From: Frank Astier To: "user@ant.apache.org" Date: Mon, 19 Dec 2011 10:25:40 -0800 Subject: Question about using Tar with Hadoop files Thread-Topic: Question about using Tar with Hadoop files Thread-Index: Acy+e5xV5xFrAXUv1kCVu0vAKY+SiA== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-Entourage/13.10.0.110428 acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_CB14C1A4C88Cfastieryahooinccom_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_CB14C1A4C88Cfastieryahooinccom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi - I=92m trying to use the Apache Tar package (1.8.2) for a Java program that = tars large files in Hadoop. I am currently failing on a file that=92s 17 GB= long. Note that this code works without any problem for smaller files. I= =92m tarring smaller HDFS files all day long without any problem. It fails = only when I have to tar that 17 GB file. I have a hard time making sense of= the error message, after looking at source code for 3 days now... The exac= t file size at the time of the error is: 17456999265 bytes. The exception I= =92m seeing is: 12/19/11 5:54 PM [BDM.main] EXCEPTION request to write '65535' bytes exceed= s size in header of '277130081' bytes 12/19/11 5:54 PM [BDM.main] EXCEPTION org.apache.tools.tar.TarOutputStream.= write(TarOutputStream.java:238) 12/19/11 5:54 PM [BDM.main] EXCEPTION com.yahoo.ads.ngdstone.tpbdm.HDFSTar.= archive(HDFSTar.java:149) My code is: TarEntry entry =3D new TarEntry(p.getName()); Path absolutePath =3D p.isAbsolute() ? p : new Path(baseDir, p);= // HDFS Path FileStatus fileStatus =3D fs.getFileStatus(absolutePath); // HDF= S fileStatus entry.setNames(fileStatus.getOwner(), fileStatus.getGroup()); entry.setUserName(user); entry.setGroupName(group); entry.setName(name); entry.setSize(fileStatus.getLen()); entry.setMode(Integer.parseInt("0100" + permissions, 8)); out.putNextEntry(entry); // out =3D TarOutputStream if (fileStatus.getLen() > 0) { InputStream in =3D fs.open(absolutePath); // large file in = HDFS try { ++nEntries; int bytesRead =3D in.read(buf); while (bytesRead >=3D 0) { out.write(buf, 0, bytesRead); bytesRead =3D in.read(buf); } } finally { in.close(); } } out.closeEntry(); Any idea? Am I missing anything in the way I=92m setting up the TarOutputSt= ream or TarEntry? Or does tar have implicit limits that are never going to = work for multi-gigabytes size files? Thanks! Frank --_000_CB14C1A4C88Cfastieryahooinccom_--