|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.crunch.types.avro.Avros
public class Avros
Defines static methods that are analogous to the methods defined in
AvroTypeFamily
for convenient static importing.
Field Summary | |
---|---|
static MapFn<Object,ByteBuffer> |
BYTES_IN
|
static boolean |
CAN_COMBINE_SPECIFIC_AND_REFLECT_SCHEMAS
Older versions of Avro (i.e., before 1.7.0) do not support schemas that are composed of a mix of specific and reflection-based schemas. |
static ReflectDataFactory |
REFLECT_DATA_FACTORY
Deprecated. as of 0.9.0; use AvroMode.REFLECT.override(ReaderWriterFactory) |
static String |
REFLECT_DATA_FACTORY_CLASS
The name of the configuration parameter that tracks which reflection factory to use. |
static MapFn<String,org.apache.avro.util.Utf8> |
STRING_TO_UTF8
|
static MapFn<CharSequence,String> |
UTF8_TO_STRING
|
Method Summary | ||
---|---|---|
static AvroType<Boolean> |
booleans()
|
|
static AvroType<ByteBuffer> |
bytes()
|
|
static void |
checkCombiningSpecificAndReflectionSchemas()
|
|
static
|
collections(PType<T> ptype)
|
|
static void |
configureReflectDataFactory(org.apache.hadoop.conf.Configuration conf)
Deprecated. as of 0.9.0; use AvroMode.REFLECT.configure(Configuration) |
|
static
|
containers(Class<T> clazz)
|
|
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 AvroType<Double> |
doubles()
|
|
static AvroType<Float> |
floats()
|
|
static AvroType<org.apache.avro.generic.GenericData.Record> |
generics(org.apache.avro.Schema schema)
|
|
static
|
getPrimitiveType(Class<T> clazz)
|
|
static ReflectDataFactory |
getReflectDataFactory(org.apache.hadoop.conf.Configuration conf)
Deprecated. as of 0.9.0; use AvroMode.fromConfiguration(conf) |
|
static AvroType<Integer> |
ints()
|
|
static
|
jsons(Class<T> clazz)
|
|
static
|
keyValueTableOf(PType<K> key,
PType<V> value)
A table type with an Avro type as key and value. |
|
static AvroType<Long> |
longs()
|
|
static
|
maps(PType<T> ptype)
|
|
static AvroType<TupleN> |
namedTuples(String tupleName,
String[] fieldNames,
PType[] ptypes)
|
|
static
|
newReader(AvroType<T> type)
|
|
static
|
newReader(org.apache.avro.Schema schema)
|
|
static
|
newWriter(AvroType<T> type)
|
|
static
|
newWriter(org.apache.avro.Schema schema)
|
|
static AvroType<Void> |
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
|
reflects(Class<T> clazz)
|
|
static
|
reflects(Class<T> clazz,
org.apache.avro.Schema schema)
|
|
static
|
register(Class<T> clazz,
AvroType<T> ptype)
|
|
static
|
specifics(Class<T> clazz)
|
|
static AvroType<String> |
strings()
|
|
static
|
tableOf(PType<K> key,
PType<V> value)
A table type with an Avro type as key and as value. |
|
static
|
triples(PType<V1> p1,
PType<V2> p2,
PType<V3> p3)
|
|
static
|
tuples(Class<T> clazz,
PType... ptypes)
|
|
static AvroType<TupleN> |
tuples(PType... ptypes)
|
|
static PType<Union> |
unionOf(PType<?>... ptypes)
|
|
static
|
writables(Class<T> clazz)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean CAN_COMBINE_SPECIFIC_AND_REFLECT_SCHEMAS
public static ReflectDataFactory REFLECT_DATA_FACTORY
AvroMode.override(ReaderWriterFactory)
.
public static final String REFLECT_DATA_FACTORY_CLASS
public static MapFn<CharSequence,String> UTF8_TO_STRING
public static MapFn<String,org.apache.avro.util.Utf8> STRING_TO_UTF8
public static MapFn<Object,ByteBuffer> BYTES_IN
Method Detail |
---|
@Deprecated public static void configureReflectDataFactory(org.apache.hadoop.conf.Configuration conf)
public static ReflectDataFactory getReflectDataFactory(org.apache.hadoop.conf.Configuration conf)
public static void checkCombiningSpecificAndReflectionSchemas()
public static <T> org.apache.avro.io.DatumReader<T> newReader(org.apache.avro.Schema schema)
public static <T> org.apache.avro.io.DatumReader<T> newReader(AvroType<T> type)
public static <T> org.apache.avro.io.DatumWriter<T> newWriter(org.apache.avro.Schema schema)
public static <T> org.apache.avro.io.DatumWriter<T> newWriter(AvroType<T> type)
public static <T> void register(Class<T> clazz, AvroType<T> ptype)
public static <T> PType<T> getPrimitiveType(Class<T> clazz)
public static final AvroType<Void> nulls()
public static final AvroType<String> strings()
public static final AvroType<Long> longs()
public static final AvroType<Integer> ints()
public static final AvroType<Float> floats()
public static final AvroType<Double> doubles()
public static final AvroType<Boolean> booleans()
public static final AvroType<ByteBuffer> bytes()
public static final <T> AvroType<T> records(Class<T> clazz)
public static final AvroType<org.apache.avro.generic.GenericData.Record> generics(org.apache.avro.Schema schema)
public static final <T> AvroType<T> containers(Class<T> clazz)
public static final <T extends org.apache.avro.specific.SpecificRecord> AvroType<T> specifics(Class<T> clazz)
public static final <T> AvroType<T> reflects(Class<T> clazz)
public static final <T> AvroType<T> reflects(Class<T> clazz, org.apache.avro.Schema schema)
public static final <T extends org.apache.hadoop.io.Writable> AvroType<T> writables(Class<T> clazz)
public static final <T> AvroType<Collection<T>> collections(PType<T> ptype)
public static final <T> AvroType<Map<String,T>> maps(PType<T> ptype)
public static final <V1,V2> AvroType<Pair<V1,V2>> pairs(PType<V1> p1, PType<V2> p2)
public static final <V1,V2,V3> AvroType<Tuple3<V1,V2,V3>> triples(PType<V1> p1, PType<V2> p2, PType<V3> p3)
public static final <V1,V2,V3,V4> AvroType<Tuple4<V1,V2,V3,V4>> quads(PType<V1> p1, PType<V2> p2, PType<V3> p3, PType<V4> p4)
public static final AvroType<TupleN> tuples(PType... ptypes)
public static final AvroType<TupleN> namedTuples(String tupleName, String[] fieldNames, PType[] ptypes)
public static <T extends Tuple> AvroType<T> tuples(Class<T> clazz, PType... ptypes)
public static PType<Union> unionOf(PType<?>... ptypes)
public static final <S,T> AvroType<T> derived(Class<T> clazz, MapFn<S,T> inputFn, MapFn<T,S> outputFn, PType<S> base)
public static final <S,T> AvroType<T> derivedImmutable(Class<T> clazz, MapFn<S,T> inputFn, MapFn<T,S> outputFn, PType<S> base)
public static <T> PType<T> jsons(Class<T> clazz)
public static final <K,V> org.apache.crunch.types.avro.AvroTableType<K,V> tableOf(PType<K> key, PType<V> value)
Pair
s that
are created using the org.apache.avro.mapred.AvroJob
class.
key
- the PType of the key in the tablevalue
- the PType of the value in the table
public static final <K,V> org.apache.crunch.types.avro.AvroKeyValueTableType<K,V> keyValueTableOf(PType<K> key, PType<V> value)
PTableType
returned by this method is specifically
for reading and writing files that are compatible with those created via the
org.apache.avro.mapreduce.AvroJob
class. For all other Avro table purposes, the
tableOf(org.apache.crunch.types.PType, org.apache.crunch.types.PType)
method should be used.
key
- the PType of the key in the tablevalue
- the PType of the value in the table
org.apache.avro.mapreduce.AvroJob
class
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |