org.apache.pig
Class FileSplitComparable

java.lang.Object
  extended by org.apache.pig.FileSplitComparable
All Implemented Interfaces:
Serializable, Comparable<FileSplitComparable>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<FileSplitComparable>

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class FileSplitComparable
extends Object
implements org.apache.hadoop.io.WritableComparable<FileSplitComparable>, Serializable

This class represents a relative position in a file. It records a filename and an offset. This allows Pig to order FileSplits.

Since:
Pig 0.7
See Also:
Serialized Form

Field Summary
protected  String filename
           
protected  Long offset
           
 
Constructor Summary
FileSplitComparable()
           
FileSplitComparable(String fileName, long offset)
           
 
Method Summary
 int compareTo(FileSplitComparable other)
           
 boolean equals(Object obj)
           
 int hashCode()
           
 void readFields(DataInput in)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

filename

protected String filename

offset

protected Long offset
Constructor Detail

FileSplitComparable

public FileSplitComparable()

FileSplitComparable

public FileSplitComparable(String fileName,
                           long offset)
Method Detail

compareTo

public int compareTo(FileSplitComparable other)
Specified by:
compareTo in interface Comparable<FileSplitComparable>

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2007-2012 The Apache Software Foundation