This project has retired. For details please refer to its Attic page.
TupleWritable (Apache Crunch 0.11.0 API)

org.apache.crunch.types.writable
Class TupleWritable

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.crunch.types.writable.TupleWritable
All Implemented Interfaces:
Comparable<TupleWritable>, org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<TupleWritable>

public class TupleWritable
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.io.WritableComparable<TupleWritable>

A serialization format for Tuple.

   tuple_writable ::= card field+
   card ::= vint
   field ::= code [body_size body]
   code ::= vint
   body_size ::= vint
   body ::= byte[]
 


Nested Class Summary
static class TupleWritable.Comparator
           
 
Constructor Summary
TupleWritable()
          Create an empty tuple with no allocated storage for writables.
TupleWritable(org.apache.hadoop.io.Writable[] values)
           
TupleWritable(org.apache.hadoop.io.Writable[] values, int[] written)
          Initialize tuple with storage; unknown whether any of them contain "written" values.
 
Method Summary
 void clear()
           
 int compareTo(TupleWritable that)
           
 boolean equals(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()
           
 void readFields(DataInput in)
          
 void set(int index, org.apache.hadoop.io.Writable w)
           
 void setConf(org.apache.hadoop.conf.Configuration conf)
           
 int size()
          The number of children in this Tuple.
 String toString()
          Convert Tuple to String as in the following.
 void write(DataOutput out)
          Writes each Writable to out.
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TupleWritable

public TupleWritable()
Create an empty tuple with no allocated storage for writables.


TupleWritable

public TupleWritable(org.apache.hadoop.io.Writable[] values)

TupleWritable

public TupleWritable(org.apache.hadoop.io.Writable[] values,
                     int[] written)
Initialize tuple with storage; unknown whether any of them contain "written" values.

Method Detail

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Specified by:
setConf in interface org.apache.hadoop.conf.Configurable
Overrides:
setConf in class org.apache.hadoop.conf.Configured

has

public boolean has(int i)
Return true if tuple has an element at the position provided.


get

public org.apache.hadoop.io.Writable get(int i)
Get ith Writable from Tuple.


size

public int size()
The number of children in this Tuple.


equals

public boolean equals(Object other)

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Convert Tuple to String as in the following. [,,...,]

Overrides:
toString in class Object

clear

public void clear()

set

public void set(int index,
                org.apache.hadoop.io.Writable w)

write

public void write(DataOutput out)
           throws IOException
Writes each Writable to out.

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

readFields

public void readFields(DataInput in)
                throws IOException

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

compareTo

public int compareTo(TupleWritable that)
Specified by:
compareTo in interface Comparable<TupleWritable>


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.