|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.crunch.types.writable.Writables
public class Writables
Defines static methods that are analogous to the methods defined in
WritableTypeFamily for convenient static importing.
| Method Summary | ||
|---|---|---|
static WritableType<Boolean,org.apache.hadoop.io.BooleanWritable> |
booleans()
|
|
static WritableType<ByteBuffer,org.apache.hadoop.io.BytesWritable> |
bytes()
|
|
static
|
collections(PType<T> ptype)
|
|
static
|
derived(Class<T> clazz,
MapFn<S,T> inputFn,
MapFn<T,S> outputFn,
PType<S> base)
|
|
static
|
derivedImmutable(Class<T> clazz,
MapFn<S,T> inputFn,
MapFn<T,S> outputFn,
PType<S> base)
|
|
static WritableType<Double,org.apache.hadoop.io.DoubleWritable> |
doubles()
|
|
static WritableType<Float,org.apache.hadoop.io.FloatWritable> |
floats()
|
|
static
|
getPrimitiveType(Class<T> clazz)
|
|
static WritableType<Integer,org.apache.hadoop.io.IntWritable> |
ints()
|
|
static
|
jsons(Class<T> clazz)
|
|
static WritableType<Long,org.apache.hadoop.io.LongWritable> |
longs()
|
|
static
|
maps(PType<T> ptype)
|
|
static WritableType<Void,org.apache.hadoop.io.NullWritable> |
nulls()
|
|
static
|
pairs(PType<V1> p1,
PType<V2> p2)
|
|
static
|
quads(PType<V1> p1,
PType<V2> p2,
PType<V3> p3,
PType<V4> p4)
|
|
static
|
records(Class<T> clazz)
|
|
static
|
register(Class<T> clazz,
WritableType<T,? extends org.apache.hadoop.io.Writable> ptype)
|
|
static void |
registerComparable(Class<? extends org.apache.hadoop.io.WritableComparable> clazz)
Registers a WritableComparable class so that it can be used for comparing the fields inside of
tuple types (e.g., pairs, trips, tupleN, etc.) for use in sorts and
secondary sorts. |
|
static void |
registerComparable(Class<? extends org.apache.hadoop.io.WritableComparable> clazz,
int code)
Registers a WritableComparable class with a given integer code to use for serializing
and deserializing instances of this class that are defined inside of tuple types (e.g., pairs,
trips, tupleN, etc.) Unregistered Writables are always serialized to bytes and
cannot be used in comparisons (e.g., sorts and secondary sorts) according to their underlying types. |
|
static WritableType<String,org.apache.hadoop.io.Text> |
strings()
|
|
static
|
tableOf(PType<K> key,
PType<V> value)
|
|
static
|
triples(PType<V1> p1,
PType<V2> p2,
PType<V3> p3)
|
|
static
|
tuples(Class<T> clazz,
PType... ptypes)
|
|
static WritableType<TupleN,TupleWritable> |
tuples(PType... ptypes)
|
|
static PType<Union> |
unionOf(PType<?>... ptypes)
|
|
static
|
writables(Class<W> clazz)
|
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void registerComparable(Class<? extends org.apache.hadoop.io.WritableComparable> clazz)
WritableComparable class so that it can be used for comparing the fields inside of
tuple types (e.g., pairs, trips, tupleN, etc.) for use in sorts and
secondary sorts.
clazz - The WritableComparable class to register
public static void registerComparable(Class<? extends org.apache.hadoop.io.WritableComparable> clazz,
int code)
WritableComparable class with a given integer code to use for serializing
and deserializing instances of this class that are defined inside of tuple types (e.g., pairs,
trips, tupleN, etc.) Unregistered Writables are always serialized to bytes and
cannot be used in comparisons (e.g., sorts and secondary sorts) according to their underlying types.
clazz - The class to registercode - The unique registration code for the class, which must be greater than or equal to 8public static <T> PType<T> getPrimitiveType(Class<T> clazz)
public static <T> void register(Class<T> clazz,
WritableType<T,? extends org.apache.hadoop.io.Writable> ptype)
public static final WritableType<Void,org.apache.hadoop.io.NullWritable> nulls()
public static final WritableType<String,org.apache.hadoop.io.Text> strings()
public static final WritableType<Long,org.apache.hadoop.io.LongWritable> longs()
public static final WritableType<Integer,org.apache.hadoop.io.IntWritable> ints()
public static final WritableType<Float,org.apache.hadoop.io.FloatWritable> floats()
public static final WritableType<Double,org.apache.hadoop.io.DoubleWritable> doubles()
public static final WritableType<Boolean,org.apache.hadoop.io.BooleanWritable> booleans()
public static final WritableType<ByteBuffer,org.apache.hadoop.io.BytesWritable> bytes()
public static final <T,W extends org.apache.hadoop.io.Writable> WritableType<T,W> records(Class<T> clazz)
public static <W extends org.apache.hadoop.io.Writable> WritableType<W,W> writables(Class<W> clazz)
public static <K,V> org.apache.crunch.types.writable.WritableTableType<K,V> tableOf(PType<K> key,
PType<V> value)
public static <V1,V2> WritableType<Pair<V1,V2>,TupleWritable> pairs(PType<V1> p1,
PType<V2> p2)
public static <V1,V2,V3> WritableType<Tuple3<V1,V2,V3>,TupleWritable> triples(PType<V1> p1,
PType<V2> p2,
PType<V3> p3)
public static <V1,V2,V3,V4> WritableType<Tuple4<V1,V2,V3,V4>,TupleWritable> quads(PType<V1> p1,
PType<V2> p2,
PType<V3> p3,
PType<V4> p4)
public static WritableType<TupleN,TupleWritable> tuples(PType... ptypes)
public static <T extends Tuple> PType<T> tuples(Class<T> clazz,
PType... ptypes)
public static PType<Union> unionOf(PType<?>... ptypes)
public static <S,T> PType<T> derived(Class<T> clazz,
MapFn<S,T> inputFn,
MapFn<T,S> outputFn,
PType<S> base)
public static <S,T> PType<T> derivedImmutable(Class<T> clazz,
MapFn<S,T> inputFn,
MapFn<T,S> outputFn,
PType<S> base)
public static <T> WritableType<Collection<T>,org.apache.crunch.types.writable.GenericArrayWritable> collections(PType<T> ptype)
public static <T> WritableType<Map<String,T>,org.apache.hadoop.io.MapWritable> maps(PType<T> ptype)
public static <T> PType<T> jsons(Class<T> clazz)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||