Package org.apache.hadoop.fs.slive.DataWriter

Examples of org.apache.hadoop.fs.slive.DataWriter.GenerateOutput


  public void testDataWriting() throws Exception {
    long byteAm = 100;
    File fn = getTestFile();
    DataWriter writer = new DataWriter(rnd);
    FileOutputStream fs = new FileOutputStream(fn);
    GenerateOutput ostat = writer.writeSegment(byteAm, fs);
    LOG.info(ostat);
    fs.close();
    assertTrue(ostat.getBytesWritten() == byteAm);
    DataVerifier vf = new DataVerifier();
    FileInputStream fin = new FileInputStream(fn);
    VerifyOutput vfout = vf.verifyFile(byteAm, new DataInputStream(fin));
    LOG.info(vfout);
    fin.close();
View Full Code Here


        // open & create
        long startTime = Timer.now();
        os = fs.create(fn, overWrite, bufSize, replicationAmount, blockSize);
        timeTaken += Timer.elapsed(startTime);
        // write the given length
        GenerateOutput stats = writer.writeSegment(writeSize, os);
        bytesWritten += stats.getBytesWritten();
        timeTaken += stats.getTimeTaken();
        // capture close time
        startTime = Timer.now();
        os.close();
        os = null;
        timeTaken += Timer.elapsed(startTime);
View Full Code Here

  public void testDataWriting() throws Exception {
    long byteAm = 100;
    File fn = getTestFile();
    DataWriter writer = new DataWriter(rnd);
    FileOutputStream fs = new FileOutputStream(fn);
    GenerateOutput ostat = writer.writeSegment(byteAm, fs);
    LOG.info(ostat);
    fs.close();
    assertTrue(ostat.getBytesWritten() == byteAm);
    DataVerifier vf = new DataVerifier();
    FileInputStream fin = new FileInputStream(fn);
    VerifyOutput vfout = vf.verifyFile(byteAm, new DataInputStream(fin));
    LOG.info(vfout);
    fin.close();
View Full Code Here

        // open
        long startTime = Timer.now();
        os = fs.append(fn);
        timeTaken += Timer.elapsed(startTime);
        // append given length
        GenerateOutput stats = writer.writeSegment(appendSize, os);
        timeTaken += stats.getTimeTaken();
        bytesAppended += stats.getBytesWritten();
        // capture close time
        startTime = Timer.now();
        os.close();
        os = null;
        timeTaken += Timer.elapsed(startTime);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.slive.DataWriter.GenerateOutput

Copyright © 2018 www.massapicom. 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.