p2pMapReduce.mapreduceModule.input
Class TextFileInputSplit_old

java.lang.Object
  extended by p2pMapReduce.mapreduceModule.input.InputSplit
      extended by p2pMapReduce.mapreduceModule.input.TextFileInputSplit_old
All Implemented Interfaces:
Writable

public class TextFileInputSplit_old
extends InputSplit


Field Summary
static java.lang.String LINE_SEPARATOR
           
 
Fields inherited from class p2pMapReduce.mapreduceModule.input.InputSplit
DESCRIPTOR_SUFFIX
 
Constructor Summary
TextFileInputSplit_old()
           
TextFileInputSplit_old(java.lang.String filePath, java.lang.String inputFilePath)
           
 
Method Summary
 long append(java.io.BufferedReader br, long bytesRemaining)
           
 long appendFrom(java.io.BufferedReader br)
          Deprecated. 
 long appendFrom(java.io.BufferedReader br, long bytesRemaining)
          Deprecated. 
 void close()
           
 java.io.File getFile()
           
 java.lang.String getInputFilePath()
           
 long getLength()
          Get the size of the split, so that the input splits can be sorted by size.
 java.lang.String[] getLocations()
          Get the list of nodes by name where the data for the split would be local.
 void readFields(java.io.DataInput in)
          Deserialize the fields of this object from in.
 java.lang.String toString()
           
 void write(java.io.DataOutput out)
          Serialize the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static final java.lang.String LINE_SEPARATOR
Constructor Detail

TextFileInputSplit_old

public TextFileInputSplit_old()

TextFileInputSplit_old

public TextFileInputSplit_old(java.lang.String filePath,
                              java.lang.String inputFilePath)
                       throws java.io.FileNotFoundException,
                              java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException
Method Detail

getFile

public java.io.File getFile()

getInputFilePath

public java.lang.String getInputFilePath()

appendFrom

@Deprecated
public long appendFrom(java.io.BufferedReader br)
                throws java.io.FileNotFoundException,
                       java.io.IOException
Deprecated. 

Append the file content starting from source current position on this file split

Parameters:
srcFile -
Throws:
java.io.FileNotFoundException
java.io.IOException

appendFrom

@Deprecated
public long appendFrom(java.io.BufferedReader br,
                                  long bytesRemaining)
                throws java.io.FileNotFoundException,
                       java.io.IOException
Deprecated. 

Appends the file content line by line until at least bytesRemaining were written

Parameters:
srcFile -
bytesRemaining -
Returns:
the bytes effectively written
Throws:
java.io.FileNotFoundException
java.io.IOException

append

public long append(java.io.BufferedReader br,
                   long bytesRemaining)
            throws java.io.FileNotFoundException,
                   java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

getLength

public long getLength()
               throws java.io.IOException,
                      java.lang.InterruptedException
Description copied from class: InputSplit
Get the size of the split, so that the input splits can be sorted by size.

Specified by:
getLength in class InputSplit
Returns:
the number of bytes in the split
Throws:
java.io.IOException
java.lang.InterruptedException

getLocations

public java.lang.String[] getLocations()
                                throws java.io.IOException,
                                       java.lang.InterruptedException
Description copied from class: InputSplit
Get the list of nodes by name where the data for the split would be local. The locations do not need to be serialized.

Specified by:
getLocations in class InputSplit
Returns:
a new array of the node nodes.
Throws:
java.io.IOException
java.lang.InterruptedException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Description copied from interface: Writable
Serialize the fields of this object to out.

Parameters:
out - DataOuput to serialize this object into.
Throws:
java.io.IOException

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Description copied from interface: Writable
Deserialize the fields of this object from in.

For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Parameters:
in - DataInput to deseriablize this object from.
Throws:
java.io.IOException