Examples of NFSDataOutputStream


Examples of org.apache.nutch.fs.NFSDataOutputStream

  public RecordWriter getRecordWriter(NutchFileSystem fs, JobConf job,
                                      String name) throws IOException {

    File file = new File(job.getOutputDir(), name);

    final NFSDataOutputStream out =
      new NFSDataOutputStream(fs.create(file, true));

    return new RecordWriter() {
        public void write(WritableComparable key, Writable value)
          throws IOException {
          out.writeBytes(key.toString());         // BUG: assume 8-bit chars
          out.writeByte('\t');
          out.writeBytes(value.toString());       // BUG: assume 8-bit chars
          out.writeByte('\n');
        }
        public void close() throws IOException {
          out.close();
        }
      };
  }     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.