public class TupleWritable
extends java.lang.Object
implements org.apache.hadoop.io.Writable, java.lang.Iterable<org.apache.hadoop.io.Writable>
Writables.
This is *not* a general-purpose tuple type. In almost all cases, users are
encouraged to implement their own serializable types, which can perform
better validation and provide more efficient encodings than this class is
capable. TupleWritable relies on the join framework for type safety and
assumes its instances will rarely be persisted, assumptions not only
incompatible with, but contrary to the general case.Writable| Constructor and Description |
|---|
TupleWritable()
Create an empty tuple with no allocated storage for writables.
|
TupleWritable(org.apache.hadoop.io.Writable[] vals)
Initialize tuple with storage; unknown whether any of them contain
"written" values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
org.apache.hadoop.io.Writable |
get(int i)
Get ith Writable from Tuple.
|
boolean |
has(int i)
Return true if tuple has an element at the position provided.
|
int |
hashCode() |
java.util.Iterator<org.apache.hadoop.io.Writable> |
iterator()
Return an iterator over the elements in this tuple.
|
void |
readFields(java.io.DataInput in) |
int |
size()
The number of children in this Tuple.
|
java.lang.String |
toString()
Convert Tuple to String as in the following.
|
void |
write(java.io.DataOutput out)
Writes each Writable to
out. |
public TupleWritable()
public TupleWritable(org.apache.hadoop.io.Writable[] vals)
public boolean has(int i)
public org.apache.hadoop.io.Writable get(int i)
public int size()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.util.Iterator<org.apache.hadoop.io.Writable> iterator()
iterator in interface java.lang.Iterable<org.apache.hadoop.io.Writable>public java.lang.String toString()
toString in class java.lang.Objectpublic void write(java.io.DataOutput out)
throws java.io.IOException
out.
TupleWritable format:
<count><type1><type2>...<typen><obj1><obj2>...<objn>
write in interface org.apache.hadoop.io.Writablejava.io.IOExceptionpublic void readFields(java.io.DataInput in)
throws java.io.IOException
readFields in interface org.apache.hadoop.io.Writablejava.io.IOExceptionCopyright © 2009 The Apache Software Foundation