org.apache.crunch.types.writable
Class WritableTypeFamily

java.lang.Object
  extended by org.apache.crunch.types.writable.WritableTypeFamily
All Implemented Interfaces:
PTypeFamily

public class WritableTypeFamily
extends Object
implements PTypeFamily

The Writable-based implementation of the PTypeFamily interface.


Method Summary
<T> PType<T>
as(PType<T> ptype)
          Returns the equivalent of the given ptype for this family, if it exists.
 PType<Boolean> booleans()
           
 PType<ByteBuffer> bytes()
           
<T> PType<Collection<T>>
collections(PType<T> ptype)
           
<S,T> PType<T>
derived(Class<T> clazz, MapFn<S,T> inputFn, MapFn<T,S> outputFn, PType<S> base)
           
 PType<Double> doubles()
           
 PType<Float> floats()
           
static WritableTypeFamily getInstance()
           
 PType<Integer> ints()
           
 PType<Long> longs()
           
<T> PType<Map<String,T>>
maps(PType<T> ptype)
           
 PType<Void> nulls()
           
<V1,V2> PType<Pair<V1,V2>>
pairs(PType<V1> p1, PType<V2> p2)
           
<V1,V2,V3,V4>
PType<Tuple4<V1,V2,V3,V4>>
quads(PType<V1> p1, PType<V2> p2, PType<V3> p3, PType<V4> p4)
           
<T> PType<T>
records(Class<T> clazz)
           
 PType<String> strings()
           
<K,V> PTableType<K,V>
tableOf(PType<K> key, PType<V> value)
           
<V1,V2,V3> PType<Tuple3<V1,V2,V3>>
triples(PType<V1> p1, PType<V2> p2, PType<V3> p3)
           
<T extends Tuple>
PType<T>
tuples(Class<T> clazz, PType<?>... ptypes)
           
 PType<TupleN> tuples(PType<?>... ptypes)
           
<W extends org.apache.hadoop.io.Writable>
PType<W>
writables(Class<W> clazz)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static WritableTypeFamily getInstance()

nulls

public PType<Void> nulls()
Specified by:
nulls in interface PTypeFamily

strings

public PType<String> strings()
Specified by:
strings in interface PTypeFamily

longs

public PType<Long> longs()
Specified by:
longs in interface PTypeFamily

ints

public PType<Integer> ints()
Specified by:
ints in interface PTypeFamily

floats

public PType<Float> floats()
Specified by:
floats in interface PTypeFamily

doubles

public PType<Double> doubles()
Specified by:
doubles in interface PTypeFamily

booleans

public PType<Boolean> booleans()
Specified by:
booleans in interface PTypeFamily

bytes

public PType<ByteBuffer> bytes()
Specified by:
bytes in interface PTypeFamily

records

public <T> PType<T> records(Class<T> clazz)
Specified by:
records in interface PTypeFamily

writables

public <W extends org.apache.hadoop.io.Writable> PType<W> writables(Class<W> clazz)

tableOf

public <K,V> PTableType<K,V> tableOf(PType<K> key,
                                     PType<V> value)
Specified by:
tableOf in interface PTypeFamily

pairs

public <V1,V2> PType<Pair<V1,V2>> pairs(PType<V1> p1,
                                        PType<V2> p2)
Specified by:
pairs in interface PTypeFamily

triples

public <V1,V2,V3> PType<Tuple3<V1,V2,V3>> triples(PType<V1> p1,
                                                  PType<V2> p2,
                                                  PType<V3> p3)
Specified by:
triples in interface PTypeFamily

quads

public <V1,V2,V3,V4> PType<Tuple4<V1,V2,V3,V4>> quads(PType<V1> p1,
                                                      PType<V2> p2,
                                                      PType<V3> p3,
                                                      PType<V4> p4)
Specified by:
quads in interface PTypeFamily

tuples

public PType<TupleN> tuples(PType<?>... ptypes)
Specified by:
tuples in interface PTypeFamily

collections

public <T> PType<Collection<T>> collections(PType<T> ptype)
Specified by:
collections in interface PTypeFamily

maps

public <T> PType<Map<String,T>> maps(PType<T> ptype)
Specified by:
maps in interface PTypeFamily

as

public <T> PType<T> as(PType<T> ptype)
Description copied from interface: PTypeFamily
Returns the equivalent of the given ptype for this family, if it exists.

Specified by:
as in interface PTypeFamily

tuples

public <T extends Tuple> PType<T> tuples(Class<T> clazz,
                                         PType<?>... ptypes)
Specified by:
tuples in interface PTypeFamily

derived

public <S,T> PType<T> derived(Class<T> clazz,
                              MapFn<S,T> inputFn,
                              MapFn<T,S> outputFn,
                              PType<S> base)
Specified by:
derived in interface PTypeFamily


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