Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FSDataInputStream.available()


        + ", lastModTime=" + summaryFileStatus.getModificationTime());

    int dagCounter = 0;
    Map<TezDAGID, DAGSummaryData> dagSummaryDataMap =
        new HashMap<TezDAGID, DAGSummaryData>();
    while (summaryStream.available() > 0) {
      RecoveryProtos.SummaryEventProto proto =
          RecoveryProtos.SummaryEventProto.parseDelimitedFrom(summaryStream);
      HistoryEventType eventType =
          HistoryEventType.values()[proto.getEventType()];
      if (LOG.isDebugEnabled()) {
View Full Code Here


        lastInProgressDAG));
    FSDataOutputStream newDAGRecoveryStream =
        getDAGRecoveryOutputStream(currentAttemptRecoveryDataDir, lastInProgressDAG);

    boolean skipAllOtherEvents = false;
    while (dagRecoveryStream.available() > 0) {
      HistoryEvent event;
      try {
        event = getNextEvent(dagRecoveryStream);
      } catch (IOException ioe) {
        LOG.warn("Corrupt data found when trying to read next event", ioe);
View Full Code Here

        v = s2.read();
        assertEquals(v, 32);
        v = s2.read();
        assertEquals(v, 32);

        assertEquals(s2.available(), data.length);

        byte[] buf = new byte[bufsz];
        s2.read(buf, 0, buf.length);
        nread = s2.getPos();
View Full Code Here

        nread = s2.getPos();

        for (int i = 0; i < data.length; i++)
            assertEquals(data[i], buf[i]);

        assertEquals(s2.available(), 0);

        s2.close();

        // append some data to the file
        try {
View Full Code Here

    FSDataOutputStream out = fs.create(p, false, buffersize, REPLICATION,
        BLOCK_SIZE);
    FSDataInputStream in = fs.open(p);
    int available;

    available = in.available();
    TestCase.assertEquals(0, available);

    AppendTestUtil.write(out, 0, len1);
    out.sync();
View Full Code Here

    TestCase.assertEquals(0, available);

    AppendTestUtil.write(out, 0, len1);
    out.sync();

    available = in.available();
    TestCase.assertEquals(len1, available);
   
    long i = -1;
    for(i++; i < len1; i++) {
      TestCase.assertEquals((byte)i, (byte)in.read())
View Full Code Here

    long i = -1;
    for(i++; i < len1; i++) {
      TestCase.assertEquals((byte)i, (byte)in.read())
    }

    available = in.available();
    TestCase.assertEquals(0, available);

    final int len2 = (int) BLOCK_SIZE / 2 + 3;
    AppendTestUtil.write(out, len1, len2);
    out.sync();
View Full Code Here

    TestCase.assertEquals(0, available);

    final int len2 = (int) BLOCK_SIZE / 2 + 3;
    AppendTestUtil.write(out, len1, len2);
    out.sync();
    available = in.available();
    TestCase.assertEquals(len2, available);
    for(; i < len1 + len2; i++) {
      TestCase.assertEquals((byte)i, (byte)in.read())
    }
    available = in.available();
View Full Code Here

    available = in.available();
    TestCase.assertEquals(len2, available);
    for(; i < len1 + len2; i++) {
      TestCase.assertEquals((byte)i, (byte)in.read())
    }
    available = in.available();
    TestCase.assertEquals(0, available);

    // test available update until end of the block
    final int len3 = (int) BLOCK_SIZE / 2;
    AppendTestUtil.write(out, len1 + len2, len3);
View Full Code Here

    // test available update until end of the block
    final int len3 = (int) BLOCK_SIZE / 2;
    AppendTestUtil.write(out, len1 + len2, len3);
    out.sync();
    available = in.available();
    TestCase.assertEquals((int) BLOCK_SIZE / 2, available);
    for(; i < len1 + len2 + len3; i++) {
      TestCase.assertEquals(i +" th number is wrong..", (byte)i, (byte)in.read())
    }
    available = in.available();
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.