Package org.apache.hadoop.fs

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


    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 {
          out.close();
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

    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 {
          out.close();
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

        CreateOpts.repFac((short) 3));
    executionTime[CREATE] += (System.currentTimeMillis()-startTime);
    totalNumOfOps[CREATE]++;

    for (long i=0; i<fileSize; i++) {
      out.writeByte('a');
    }
    startTime = System.currentTimeMillis();
    out.close();
    executionTime[WRITE_CLOSE] += (System.currentTimeMillis()-startTime);
    totalNumOfOps[WRITE_CLOSE]++;
View Full Code Here

    FSDataOutputStream out = fc.create(file,
        EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE),
        CreateOpts.createParent(), CreateOpts.bufferSize(4096),
        CreateOpts.repFac((short) 3));
    for(long i=0; i<fileSize; i++) {
      out.writeByte('a');
    }
    out.close();
  }
 
  /** Main program.
View Full Code Here

        fs.getDefaultBlockSize());
    executionTime[CREATE] += (System.currentTimeMillis()-startTime);
    totalNumOfOps[CREATE]++;

    for (long i=0; i<fileSize; i++) {
      out.writeByte('a');
    }
    startTime = System.currentTimeMillis();
    out.close();
    executionTime[WRITE_CLOSE] += (System.currentTimeMillis()-startTime);
    totalNumOfOps[WRITE_CLOSE]++;
View Full Code Here

        fs.getDefaultBlockSize());
    executionTime[CREATE] += (System.currentTimeMillis()-startTime);
    totalNumOfOps[CREATE]++;

    for (long i=0; i<fileSize; i++) {
      out.writeByte('a');
    }
    startTime = System.currentTimeMillis();
    out.close();
    executionTime[WRITE_CLOSE] += (System.currentTimeMillis()-startTime);
    totalNumOfOps[WRITE_CLOSE]++;
View Full Code Here

    FSDataOutputStream out = fs.create(file, true,
        getConf().getInt("io.file.buffer.size", 4096),
        (short)getConf().getInt("dfs.replication", 3),
        fs.getDefaultBlockSize());
    for(long i=0; i<fileSize; i++) {
      out.writeByte('a');
    }
    out.close();
  }
 
  /** Main program.
View Full Code Here

    // rename bar --> bar2
    final Path bar2 = new Path(foo, "bar2");
    hdfs.rename(bar, bar2);
    // append file and keep it as underconstruction.
    FSDataOutputStream out = hdfs.append(bar2);
    out.writeByte(0);
    ((DFSOutputStream) out.getWrappedStream()).hsync(
        EnumSet.of(SyncFlag.UPDATE_LENGTH));

    // save namespace and restart
    restartClusterAndCheckImage(true);
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.