You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Olivier Smadja <os...@gmail.com> on 2009/05/28 15:46:48 UTC

Appending to a file / updating a file

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

Re: Appending to a file / updating a file

Posted by Sasha Dolgy <sd...@gmail.com>.
did you restart hadoop?  sorry i'm stuck in the middle of something so
can't give this more attention.  i can assure you however that we have
append working in our POC ... and the code isn't that much different
to what you have posted.

-sd

On Thu, May 28, 2009 at 3:31 PM, Olivier Smadja <os...@gmail.com> wrote:
> Thanks Sacha,
>
> I have now my hdfs-site.xml like that : (as the hadoop-site.xml seems to be
> deprecated)
>
> <configuration>
>    <property>
>        <name>dfs.support.append</name>
>        <value>true</value>
>    </property>
> </configuration>
>
> But I continue receiving the exception.
>
> Checking the hadoop source code, I saw
>
>  public FSDataOutputStream append(Path f, int bufferSize,
>      Progressable progress) throws IOException {
>    throw new IOException("Not supported");
>  }
>
> in the class org.apache.hadoop.fs.ChecksumFileSystem and this is where the
> exception is thrown. my fileSystem is a LocalFileSystem instance that
> inherits the ChecksumFileSystem and the append method has not beem
> overriden.
>
> Whereas in the DistributedFileSystem, the append method is defined like
> this:
>
>  /** This optional operation is not yet supported. */
>  public FSDataOutputStream append(Path f, int bufferSize,
>      Progressable progress) throws IOException {
>
>    DFSOutputStream op = (DFSOutputStream)dfs.append(getPathName(f),
> bufferSize, progress);
>    return new FSDataOutputStream(op, statistics, op.getInitialLen());
>  }
>
> even if the comment still say it is not supported, it seems to do
> something....
>
> So this makes me think that append is not supported on hadoop
> LocalFileSystem.
>
> Is it correct?
>
> Thanks,
> Olivier
>
>
>
>
>
> On Thu, May 28, 2009 at 11:06 AM, Sasha Dolgy <sd...@gmail.com> wrote:
>
>> http://www.mail-archive.com/core-user@hadoop.apache.org/msg10002.html
>>
>>
>> On Thu, May 28, 2009 at 3:03 PM, Olivier Smadja <os...@gmail.com> wrote:
>> > Hi Sacha!
>> >
>> > Thanks for the quick answer. Is there a simple way to search the mailing
>> > list? by text or by author.
>> >
>> > At http://mail-archives.apache.org/mod_mbox/hadoop-core-user/ I only see
>> a
>> > browse per month...
>> >
>> > Thanks,
>> > Olivier
>> >
>> >
>> > On Thu, May 28, 2009 at 10:57 AM, Sasha Dolgy <sd...@gmail.com> wrote:
>> >
>> >> append isn't supported without modifying the configuration file for
>> >> hadoop.  check out the mailling list threads ... i've sent a post in
>> >> the past explaining how to enable it.
>> >>
>> >> On Thu, May 28, 2009 at 2:46 PM, Olivier Smadja <os...@gmail.com>
>> wrote:
>> >> > 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
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Sasha Dolgy
>> >> sasha.dolgy@gmail.com
>> >>
>> >
>>
>>
>>
>> --
>> Sasha Dolgy
>> sasha.dolgy@gmail.com
>>
>



-- 
Sasha Dolgy
sasha.dolgy@gmail.com

Re: Appending to a file / updating a file

Posted by Olivier Smadja <os...@gmail.com>.
Thanks Sacha,

I have now my hdfs-site.xml like that : (as the hadoop-site.xml seems to be
deprecated)

<configuration>
    <property>
        <name>dfs.support.append</name>
        <value>true</value>
    </property>
</configuration>

But I continue receiving the exception.

Checking the hadoop source code, I saw

 public FSDataOutputStream append(Path f, int bufferSize,
      Progressable progress) throws IOException {
    throw new IOException("Not supported");
  }

in the class org.apache.hadoop.fs.ChecksumFileSystem and this is where the
exception is thrown. my fileSystem is a LocalFileSystem instance that
inherits the ChecksumFileSystem and the append method has not beem
overriden.

Whereas in the DistributedFileSystem, the append method is defined like
this:

  /** This optional operation is not yet supported. */
  public FSDataOutputStream append(Path f, int bufferSize,
      Progressable progress) throws IOException {

    DFSOutputStream op = (DFSOutputStream)dfs.append(getPathName(f),
bufferSize, progress);
    return new FSDataOutputStream(op, statistics, op.getInitialLen());
  }

even if the comment still say it is not supported, it seems to do
something....

So this makes me think that append is not supported on hadoop
LocalFileSystem.

Is it correct?

Thanks,
Olivier





On Thu, May 28, 2009 at 11:06 AM, Sasha Dolgy <sd...@gmail.com> wrote:

> http://www.mail-archive.com/core-user@hadoop.apache.org/msg10002.html
>
>
> On Thu, May 28, 2009 at 3:03 PM, Olivier Smadja <os...@gmail.com> wrote:
> > Hi Sacha!
> >
> > Thanks for the quick answer. Is there a simple way to search the mailing
> > list? by text or by author.
> >
> > At http://mail-archives.apache.org/mod_mbox/hadoop-core-user/ I only see
> a
> > browse per month...
> >
> > Thanks,
> > Olivier
> >
> >
> > On Thu, May 28, 2009 at 10:57 AM, Sasha Dolgy <sd...@gmail.com> wrote:
> >
> >> append isn't supported without modifying the configuration file for
> >> hadoop.  check out the mailling list threads ... i've sent a post in
> >> the past explaining how to enable it.
> >>
> >> On Thu, May 28, 2009 at 2:46 PM, Olivier Smadja <os...@gmail.com>
> wrote:
> >> > 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
> >> >
> >>
> >>
> >>
> >> --
> >> Sasha Dolgy
> >> sasha.dolgy@gmail.com
> >>
> >
>
>
>
> --
> Sasha Dolgy
> sasha.dolgy@gmail.com
>

Re: Appending to a file / updating a file

Posted by Sasha Dolgy <sd...@gmail.com>.
http://www.mail-archive.com/core-user@hadoop.apache.org/msg10002.html


On Thu, May 28, 2009 at 3:03 PM, Olivier Smadja <os...@gmail.com> wrote:
> Hi Sacha!
>
> Thanks for the quick answer. Is there a simple way to search the mailing
> list? by text or by author.
>
> At http://mail-archives.apache.org/mod_mbox/hadoop-core-user/ I only see a
> browse per month...
>
> Thanks,
> Olivier
>
>
> On Thu, May 28, 2009 at 10:57 AM, Sasha Dolgy <sd...@gmail.com> wrote:
>
>> append isn't supported without modifying the configuration file for
>> hadoop.  check out the mailling list threads ... i've sent a post in
>> the past explaining how to enable it.
>>
>> On Thu, May 28, 2009 at 2:46 PM, Olivier Smadja <os...@gmail.com> wrote:
>> > 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
>> >
>>
>>
>>
>> --
>> Sasha Dolgy
>> sasha.dolgy@gmail.com
>>
>



-- 
Sasha Dolgy
sasha.dolgy@gmail.com

Re: Appending to a file / updating a file

Posted by Olivier Smadja <os...@gmail.com>.
Hi Sacha!

Thanks for the quick answer. Is there a simple way to search the mailing
list? by text or by author.

At http://mail-archives.apache.org/mod_mbox/hadoop-core-user/ I only see a
browse per month...

Thanks,
Olivier


On Thu, May 28, 2009 at 10:57 AM, Sasha Dolgy <sd...@gmail.com> wrote:

> append isn't supported without modifying the configuration file for
> hadoop.  check out the mailling list threads ... i've sent a post in
> the past explaining how to enable it.
>
> On Thu, May 28, 2009 at 2:46 PM, Olivier Smadja <os...@gmail.com> wrote:
> > 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
> >
>
>
>
> --
> Sasha Dolgy
> sasha.dolgy@gmail.com
>

Re: Appending to a file / updating a file

Posted by Sasha Dolgy <sd...@gmail.com>.
append isn't supported without modifying the configuration file for
hadoop.  check out the mailling list threads ... i've sent a post in
the past explaining how to enable it.

On Thu, May 28, 2009 at 2:46 PM, Olivier Smadja <os...@gmail.com> wrote:
> 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
>



-- 
Sasha Dolgy
sasha.dolgy@gmail.com

Re: Appending to a file / updating a file

Posted by Olivier Smadja <os...@gmail.com>.
Thanks Damien.

And can i update a file with hadoop or just create it and read it later?

Olivier

On Thu, May 28, 2009 at 1:31 PM, Damien Cooke <Da...@sun.com> wrote:

> Olivier,
> Append is not supported or recommended at this point.  You can turn it on
> via dfs.support.append in hdfs-site.xml under 0.20.0.  There have been some
> issues making it reliable.  If this is not production code or a production
> job then turning it on will probably have no detrimental effect, but be
> aware it might destroy your data as it is not recommended at this point.
>
> Regards
> Damien
>
> On 28/05/2009, at 6:46 AM, Olivier Smadja wrote:
>
>  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
>>
>
>
> Damien Cooke
> Open Scalable Solutions Performance
> Performance & Applications Engineering
>
> Sun Microsystems
> Level 2, East Wing 50 Grenfell Street, Adelaide
> SA 5000 Australia
> Phone x58315 (x7058315 US callers)
> Email Damien.Cooke@Sun.Com
>
>

Re: Appending to a file / updating a file

Posted by Damien Cooke <Da...@Sun.COM>.
Olivier,
Append is not supported or recommended at this point.  You can turn it  
on via dfs.support.append in hdfs-site.xml under 0.20.0.  There have  
been some issues making it reliable.  If this is not production code  
or a production job then turning it on will probably have no  
detrimental effect, but be aware it might destroy your data as it is  
not recommended at this point.

Regards
Damien
On 28/05/2009, at 6:46 AM, Olivier Smadja wrote:

> 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


Damien Cooke
Open Scalable Solutions Performance
Performance & Applications Engineering

Sun Microsystems
Level 2, East Wing 50 Grenfell Street, Adelaide
SA 5000 Australia
Phone x58315 (x7058315 US callers)
Email Damien.Cooke@Sun.Com