hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shensl <shenshanli...@163.com>
Subject Can a map/reduce read local file system?
Date Thu, 11 Mar 2010 16:05:41 GMT
Can map/reduce read local file system? My map/reduce cannot read localhost file, is there any
wrong in my code ? 

    protected void map(Object arg0, Object arg1, Context context)
            throws IOException, InterruptedException {
        Configuration conf = context.getConfiguration();
        LocalFileSystem lfs = FileSystem.getLocal(conf);
        FSDataOutputStream out = lfs.create(new Path("abc.txt"));
        out.writeUTF("abc");
        out.close();
    }

Thanks and Regards!
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message