org.terrier.structures.indexing.singlepass.hadoop
Class PositionAwareSplit<T extends org.apache.hadoop.mapred.InputSplit>

java.lang.Object
  extended by org.terrier.structures.indexing.singlepass.hadoop.PositionAwareSplit<T>
Type Parameters:
T -
All Implemented Interfaces:
org.apache.hadoop.io.Writable, org.apache.hadoop.mapred.InputSplit

public class PositionAwareSplit<T extends org.apache.hadoop.mapred.InputSplit>
extends java.lang.Object
implements org.apache.hadoop.mapred.InputSplit

An InputSplit, i.e. a subset of the input data. Notably, this implementation knows which split it is in the overall job, this way we can restore the ordering of the input later.

Author:
Richard McCreadie

Field Summary
protected  T split
          the wrapped split
protected  int splitnum
          the index of this split
 
Constructor Summary
PositionAwareSplit()
          Make a new split, for use in Writable serialization
PositionAwareSplit(T _split, int _splitnum)
          Make a new split with the specified attributs
 
Method Summary
 long getLength()
          
 java.lang.String[] getLocations()
          
 T getSplit()
          Get the wrapped split
 int getSplitIndex()
          Get the index of this split
 void readFields(java.io.DataInput in)
          
 void setSplit(T _split)
          Set the wrapped split
 void setSplitIndex(int _splitnum)
          Set the index of this split
 void write(java.io.DataOutput out)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

split

protected T extends org.apache.hadoop.mapred.InputSplit split
the wrapped split


splitnum

protected int splitnum
the index of this split

Constructor Detail

PositionAwareSplit

public PositionAwareSplit()
Make a new split, for use in Writable serialization


PositionAwareSplit

public PositionAwareSplit(T _split,
                          int _splitnum)
Make a new split with the specified attributs

Method Detail

getSplitIndex

public int getSplitIndex()
Get the index of this split

Returns:
the splitnum

setSplitIndex

public void setSplitIndex(int _splitnum)
Set the index of this split

Parameters:
_splitnum - the splitnum to set

getSplit

public T getSplit()
Get the wrapped split

Returns:
the split

setSplit

public void setSplit(T _split)
Set the wrapped split

Parameters:
_split - the split to set

getLength

public long getLength()
               throws java.io.IOException

Specified by:
getLength in interface org.apache.hadoop.mapred.InputSplit
Throws:
java.io.IOException

getLocations

public java.lang.String[] getLocations()
                                throws java.io.IOException

Specified by:
getLocations in interface org.apache.hadoop.mapred.InputSplit
Throws:
java.io.IOException

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException

Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException


Terrier 3.5. Copyright © 2004-2011 University of Glasgow