org.apache.hadoop.mapred
Class TaskLog.Reader

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.hadoop.mapred.TaskLog.Reader
All Implemented Interfaces:
Closeable
Enclosing class:
TaskLog

public static class TaskLog.Reader
extends InputStream


Constructor Summary
TaskLog.Reader(TaskAttemptID taskid, TaskLog.LogName kind, long start, long end, boolean isCleanup)
          Read a log file from start to end positions.
 
Method Summary
 int available()
           
 void close()
           
 int read()
           
 int read(byte[] buffer, int offset, int length)
           
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskLog.Reader

public TaskLog.Reader(TaskAttemptID taskid,
                      TaskLog.LogName kind,
                      long start,
                      long end,
                      boolean isCleanup)
               throws IOException
Read a log file from start to end positions. The offsets may be negative, in which case they are relative to the end of the file. For example, Reader(taskid, kind, 0, -1) is the entire file and Reader(taskid, kind, -4197, -1) is the last 4196 bytes.

Parameters:
taskid - the id of the task to read the log file for
kind - the kind of log to read
start - the offset to read from (negative is relative to tail)
end - the offset to read upto (negative is relative to tail)
isCleanup - whether the attempt is cleanup attempt or not
Throws:
IOException
Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] buffer,
                int offset,
                int length)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException


Copyright © 2012 Apache Software Foundation. All Rights Reserved.