org.apache.hadoop.mapred
Class TaskLog.Reader
java.lang.Object
java.io.InputStream
org.apache.hadoop.mapred.TaskLog.Reader
- All Implemented Interfaces:
- Closeable
- Enclosing class:
- TaskLog
public static class TaskLog.Reader
- extends InputStream
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 forkind - the kind of log to readstart - 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
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 © 2013 Apache Software Foundation. All Rights Reserved.