Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeByte()


    final boolean mc)
  throws IOException {
    Path p = getInfoFilePath();
    FSDataOutputStream out = filesystem.create(p);
    try {
      out.writeByte(INFO_SEQ_NUM);
      out.writeLong(infonum);
      if (mc) {
        // Set whether major compaction flag on this file.
        this.majorCompaction = mc;
        out.writeByte(MAJOR_COMPACTION);
View Full Code Here


      out.writeByte(INFO_SEQ_NUM);
      out.writeLong(infonum);
      if (mc) {
        // Set whether major compaction flag on this file.
        this.majorCompaction = mc;
        out.writeByte(MAJOR_COMPACTION);
        out.writeBoolean(mc);
      }
    } finally {
      out.close();
    }
View Full Code Here

    return new RecordWriter() {

      public synchronized void write(WritableComparable key, Writable value) throws IOException {
        out.write(key.toString().getBytes("UTF-8"));
        out.writeByte('\t');
        out.write(value.toString().getBytes("UTF-8"));
        out.writeByte('\n');
      }

      public synchronized void close(Reporter reporter) throws IOException {
View Full Code Here

      public synchronized void write(WritableComparable key, Writable value) throws IOException {
        out.write(key.toString().getBytes("UTF-8"));
        out.writeByte('\t');
        out.write(value.toString().getBytes("UTF-8"));
        out.writeByte('\n');
      }

      public synchronized void close(Reporter reporter) throws IOException {
        out.close();
      }
View Full Code Here

   */
  void writeInfo(FileSystem fs, long infonum) throws IOException {
    Path p = getInfoFilePath();
    FSDataOutputStream out = fs.create(p);
    try {
      out.writeByte(INFO_SEQ_NUM);
      out.writeLong(infonum);
    } finally {
      out.close();
    }
  }
View Full Code Here

    return new RecordWriter() {

      public synchronized void write(WritableComparable key, Writable value) throws IOException {
        out.write(key.toString().getBytes("UTF-8"));
        out.writeByte('\t');
        out.write(value.toString().getBytes("UTF-8"));
        out.writeByte('\n');
      }

      public synchronized void close(Reporter reporter) throws IOException {
View Full Code Here

      public synchronized void write(WritableComparable key, Writable value) throws IOException {
        out.write(key.toString().getBytes("UTF-8"));
        out.writeByte('\t');
        out.write(value.toString().getBytes("UTF-8"));
        out.writeByte('\n');
      }

      public synchronized void close(Reporter reporter) throws IOException {
        out.close();
      }
View Full Code Here

   */
  void writeInfo(FileSystem fs, long infonum) throws IOException {
    Path p = getInfoFilePath();
    FSDataOutputStream out = fs.create(p);
    try {
      out.writeByte(INFO_SEQ_NUM);
      out.writeLong(infonum);
    } finally {
      out.close();
    }
  }
View Full Code Here

   */
  void writeInfo(FileSystem fs, long infonum) throws IOException {
    Path p = getInfoFilePath();
    FSDataOutputStream out = fs.create(p);
    try {
      out.writeByte(INFO_SEQ_NUM);
      out.writeLong(infonum);
    } finally {
      out.close();
    }
  }
View Full Code Here

    // Start writing a file with 2 replicas to ensure each datanode has one.
    // Block Size is 1MB.
    String src = FILE_NAME_PREFIX + "test_quota1";
    FSDataOutputStream fout = fs.create(new Path(src), true, 4096, (short)2, 1024 * 1024);
    for (int i = 0; i < 1024; i++) {
      fout.writeByte(123);
    }

    // Shutdown one datanode, causing the block abandonment.
    cluster.getDataNodes().get(0).shutdown();

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.