Return-Path: Delivered-To: apmail-hadoop-core-user-archive@www.apache.org Received: (qmail 89175 invoked from network); 28 May 2009 13:47:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 May 2009 13:47:27 -0000 Received: (qmail 7010 invoked by uid 500); 28 May 2009 13:47:37 -0000 Delivered-To: apmail-hadoop-core-user-archive@hadoop.apache.org Received: (qmail 6928 invoked by uid 500); 28 May 2009 13:47:37 -0000 Mailing-List: contact core-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-user@hadoop.apache.org Delivered-To: mailing list core-user@hadoop.apache.org Received: (qmail 6918 invoked by uid 99); 28 May 2009 13:47:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 13:47:37 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of osmadja@gmail.com designates 74.125.46.28 as permitted sender) Received: from [74.125.46.28] (HELO yw-out-2324.google.com) (74.125.46.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 13:47:29 +0000 Received: by yw-out-2324.google.com with SMTP id 9so2793585ywe.29 for ; Thu, 28 May 2009 06:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=F3SNxLrls0lz6fU4pooamtH43cndw6tS9pgR6MofLVI=; b=o+BKBaHspU9BcJfqHbTOHA5/bKRCckwzGt6MSIk60aHzYDYE/RGm3WLGKIJJhChGdI nYhAGgi4nW0u8S9UXp2zAB/G64hBIIcDndu9Htf7AhhewBMxU0ULHk1LZqneiXkNOQsJ 1xSAqyXuI1iAbNjdK3JIZpwpPhEOgCf5N3On0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=aJpCCF9yBus15UB/afn/R/7cOuuVHb9voTKZ0yB59PoinGzbkbTEaXBl2UsgqZLybC hN7Llx9gLuhTG8BkA0eV6m6AaXD7D8Op8w6h1Cu/Z45Ow01YcmFTn4aFWKHo7Lvzylcd jlzouBgFGCPIuaTjH1HfG3QlJZq3DoBMIcsCk= MIME-Version: 1.0 Received: by 10.150.189.1 with SMTP id m1mr2671627ybf.335.1243518428322; Thu, 28 May 2009 06:47:08 -0700 (PDT) From: Olivier Smadja Date: Thu, 28 May 2009 10:46:48 -0300 Message-ID: Subject: Appending to a file / updating a file To: core-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=000e0cd67012311e10046af9320e X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd67012311e10046af9320e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I'm trying hadoop for the first time and I'm just trying to create a file and append some text in it with the following code: import java.io.IOException; import org.apache.hadoop.conf. Configuration; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; /** * @author olivier * */ public class HadoopIO { public static void main(String[] args) throws IOException { String directory = "/Users/olivier/tmp/hadoop-data"; Configuration conf = new Configuration(true); Path path = new Path(directory); // Create the File system FileSystem fs = path.getFileSystem(conf); // Sets the working directory fs.setWorkingDirectory(path); System.out.println(fs.getWorkingDirectory()); // Creates a files FSDataOutputStream out = fs.create(new Path("test.txt")); out.writeBytes("Testing hadoop - first line"); out.close(); // then try to append something out = fs.append(new Path("test.txt")); out.writeBytes("Testing hadoop - second line"); out.close(); fs.close(); } } but I receive the following exception: Exception in thread "main" java.io.IOException: Not supported at org.apache.hadoop.fs.ChecksumFileSystem.append(ChecksumFileSystem.java:290) at org.apache.hadoop.fs.FileSystem.append(FileSystem.java:525) at com.neodatis.odb.hadoop.HadoopIO.main(HadoopIO.java:38) 1) Can someone tell me what am i doing wrong? 2) How can I update the file (for example, just update the first 10 bytes of the file)? Thanks, Olivier --000e0cd67012311e10046af9320e--