com.cloudera.crunch.type
Interface PType<T>

All Known Subinterfaces:
PTableType<K,V>
All Known Implementing Classes:
AvroGroupedTableType, AvroTableType, AvroType, PGroupedTableType, WritableGroupedTableType, WritableType

public interface PType<T>

A PType defines a mapping between a data type that is used in a Crunch pipeline and a serialization and storage format that is used to read/write data from/to HDFS. Every PCollection has an associated PType that tells Crunch how to read/write data from that PCollection.


Method Summary
 Converter getConverter()
           
 SourceTarget<T> getDefaultFileSource(org.apache.hadoop.fs.Path path)
          Returns a SourceTarget that is able to read/write data using the serialization format specified by this PType.
 PTypeFamily getFamily()
          Returns the PTypeFamily that this PType belongs to.
 MapFn<Object,T> getInputMapFn()
           
 MapFn<T,Object> getOutputMapFn()
           
 List<PType> getSubTypes()
          Returns the sub-types that make up this PType if it is a composite instance, such as a tuple.
 Class<T> getTypeClass()
          Returns the Java type represented by this PType.
 

Method Detail

getTypeClass

Class<T> getTypeClass()
Returns the Java type represented by this PType.


getFamily

PTypeFamily getFamily()
Returns the PTypeFamily that this PType belongs to.


getInputMapFn

MapFn<Object,T> getInputMapFn()

getOutputMapFn

MapFn<T,Object> getOutputMapFn()

getConverter

Converter getConverter()

getDefaultFileSource

SourceTarget<T> getDefaultFileSource(org.apache.hadoop.fs.Path path)
Returns a SourceTarget that is able to read/write data using the serialization format specified by this PType.


getSubTypes

List<PType> getSubTypes()
Returns the sub-types that make up this PType if it is a composite instance, such as a tuple.



Copyright © 2012. All Rights Reserved.