org.apache.hadoop.tools.rumen
Class DefaultInputDemuxer

java.lang.Object
  extended by org.apache.hadoop.tools.rumen.DefaultInputDemuxer
All Implemented Interfaces:
Closeable, InputDemuxer

public class DefaultInputDemuxer
extends Object
implements InputDemuxer

DefaultInputDemuxer acts as a pass-through demuxer. It just opens each file and returns back the input stream. If the input is compressed, it would return a decompression stream.


Constructor Summary
DefaultInputDemuxer()
           
 
Method Summary
 void bindTo(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf)
          Bind the InputDemuxer to a particular file.
 void close()
           
 org.apache.hadoop.tools.rumen.Pair<String,InputStream> getNext()
          Get the next pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInputDemuxer

public DefaultInputDemuxer()
Method Detail

bindTo

public void bindTo(org.apache.hadoop.fs.Path path,
                   org.apache.hadoop.conf.Configuration conf)
            throws IOException
Description copied from interface: InputDemuxer
Bind the InputDemuxer to a particular file.

Specified by:
bindTo in interface InputDemuxer
Parameters:
path - The path to the file it should bind to.
conf - Configuration
Throws:
IOException - Returns true when the binding succeeds. If the file can be read but is in the wrong format, returns false. IOException is reserved for read errors.

getNext

public org.apache.hadoop.tools.rumen.Pair<String,InputStream> getNext()
                                                               throws IOException
Description copied from interface: InputDemuxer
Get the next pair. The name should preserve the original job history file or job conf file name. The input object should be closed before calling getNext() again. The old input object would be invalid after calling getNext() again.

Specified by:
getNext in interface InputDemuxer
Returns:
the next pair.
Throws:
IOException

close

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


Copyright © 2009 The Apache Software Foundation