cascading.tuple.hadoop

## Class TupleSerialization

- java.lang.Object
- - org.apache.hadoop.conf.Configured
  - - cascading.tuple.hadoop.TupleSerialization

All Implemented Interfaces:
  org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.serializer.Serialization

    public class TupleSerialization
    extends org.apache.hadoop.conf.Configured
    implements org.apache.hadoop.io.serializer.Serialization

Class TupleSerialization is an implementation of Hadoop's `Serialization` interface.

Typically developers will not use this implementation directly as it is automatically added to any relevant MapReduce jobs via the `Configuration`.

By default, all primitive types are natively handled, and `BytesWritable` has a pre-configured serialization token since byte arrays are not handled natively by `Tuple`.

To add or manipulate Hadoop serializations or Cascading serializations tokens, see `TupleSerializationProps` for a fluent property builder class.

By default this Serialization interface registers the class `ByteWritable` as token 127.

### Nested Class Summary

Nested Classes
`static class` `TupleSerialization.SerializationElementReader`
`static class` `TupleSerialization.SerializationElementWriter`

### Constructor Summary

Constructors
Constructor and Description
`TupleSerialization()` Constructor TupleSerialization creates a new TupleSerialization instance.
`TupleSerialization(org.apache.hadoop.conf.Configuration conf)` Constructor TupleSerialization creates a new TupleSerialization instance.
`TupleSerialization(FlowProcess<? extends org.apache.hadoop.conf.Configuration> flowProcess)`

### Method Summary

Methods
`boolean` `accept(java.lang.Class c)` Method accept implements `Serialization.accept(Class)`.
`boolean` `areTypesIgnored()`
`boolean` `areTypesRequired()`
`java.lang.Class` `getClass(java.lang.String className)`
`java.util.Comparator` `getComparator(java.lang.Class type)`
`org.apache.hadoop.conf.Configuration` `getConf()`
`java.util.Comparator` `getDefaultComparator()`
`static java.util.Comparator` `getDefaultComparator(java.util.Comparator comparator, org.apache.hadoop.conf.Configuration jobConf)`
`static java.util.Comparator` `getDefaultComparator(org.apache.hadoop.conf.Configuration jobConf)`
`org.apache.hadoop.io.serializer.Deserializer` `getDeserializer(java.lang.Class c)` Method getDeserializer implements `Serialization.getDeserializer(Class)`.
`TupleSerialization.SerializationElementReader` `getElementReader()` Method getElementReader returns the elementReader of this TupleSerialization object.
`TupleSerialization.SerializationElementWriter` `getElementWriter()` Method getElementWriter returns the elementWriter of this TupleSerialization object.
`static java.util.Map<java.lang.Integer,Fields>` `getFields(org.apache.hadoop.conf.Configuration conf, java.lang.String property)`
`java.lang.Integer` `getFirstOrdinal()`
`Fields` `getKeyFields()`
`java.util.Map<java.lang.Integer,Fields>` `getKeyFieldsMap()`
`java.util.Map<java.lang.Integer,java.lang.Class[]>` `getKeyTypeMap()`
`java.lang.Class[]` `getKeyTypes()`
`Fields` `getMaskedValueFields()`
`java.util.Map<java.lang.Integer,java.lang.Class[]>` `getMaskedValueTypeMap()`
`java.util.List<java.lang.Integer>` `getOrdinals()`
`org.apache.hadoop.io.serializer.Serializer` `getSerializer(java.lang.Class c)` Method getSerializer implements `Serialization.getSerializer(Class)`.
`Fields` `getSortFields()`
`java.util.Map<java.lang.Integer,Fields>` `getSortFieldsMap()`
`java.lang.Class[]` `getSortTypes()`
`java.lang.Class[]` `getTypesFor(Fields fields)`
`Fields` `getValueFields()`
`java.util.Map<java.lang.Integer,Fields>` `getValueFieldsMap()`
`java.util.Map<java.lang.Integer,java.lang.Class[]>` `getValueTypeMap()`
`java.lang.Class[]` `getValueTypes()`
`void` `setConf(org.apache.hadoop.conf.Configuration conf)`
`static void` `setSerializations(org.apache.hadoop.conf.Configuration jobConf)` Adds this class as a Hadoop Serialization class.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TupleSerialization

    public TupleSerialization()

Constructor TupleSerialization creates a new TupleSerialization instance.

#### TupleSerialization

    public TupleSerialization(FlowProcess<? extends org.apache.hadoop.conf.Configuration> flowProcess)

#### TupleSerialization

    public TupleSerialization(org.apache.hadoop.conf.Configuration conf)

Constructor TupleSerialization creates a new TupleSerialization instance.

Parameters:
  `conf` - of type Configuration

### Method Detail

#### setSerializations

    public static void setSerializations(org.apache.hadoop.conf.Configuration jobConf)

Adds this class as a Hadoop Serialization class. This method is safe to call redundantly.

This method will guarantee `TupleSerialization` and `WritableSerialization` are first in the list, as both are required.

Parameters:
  `jobConf` - of type JobConf

#### getDefaultComparator

    public static java.util.Comparator getDefaultComparator(java.util.Comparator comparator,
                                            org.apache.hadoop.conf.Configuration jobConf)

#### getDefaultComparator

    public static java.util.Comparator getDefaultComparator(org.apache.hadoop.conf.Configuration jobConf)

#### 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`

#### getConf

    public org.apache.hadoop.conf.Configuration getConf()

Specified by:
  `getConf` in interface `org.apache.hadoop.conf.Configurable`
Overrides:
  `getConf` in class `org.apache.hadoop.conf.Configured`

#### areTypesIgnored

    public boolean areTypesIgnored()

#### areTypesRequired

    public boolean areTypesRequired()

#### getKeyFields

    public Fields getKeyFields()

#### getKeyTypes

    public java.lang.Class[] getKeyTypes()

#### getTypesFor

    public java.lang.Class[] getTypesFor(Fields fields)

#### getSortFields

    public Fields getSortFields()

#### getSortTypes

    public java.lang.Class[] getSortTypes()

#### getValueFields

    public Fields getValueFields()

#### getMaskedValueFields

    public Fields getMaskedValueFields()

#### getValueTypes

    public java.lang.Class[] getValueTypes()

#### getKeyTypeMap

    public java.util.Map<java.lang.Integer,java.lang.Class[]> getKeyTypeMap()

#### getValueTypeMap

    public java.util.Map<java.lang.Integer,java.lang.Class[]> getValueTypeMap()

#### getMaskedValueTypeMap

    public java.util.Map<java.lang.Integer,java.lang.Class[]> getMaskedValueTypeMap()

#### getOrdinals

    public java.util.List<java.lang.Integer> getOrdinals()

#### getFirstOrdinal

    public java.lang.Integer getFirstOrdinal()

#### getKeyFieldsMap

    public java.util.Map<java.lang.Integer,Fields> getKeyFieldsMap()

#### getSortFieldsMap

    public java.util.Map<java.lang.Integer,Fields> getSortFieldsMap()

#### getValueFieldsMap

    public java.util.Map<java.lang.Integer,Fields> getValueFieldsMap()

#### getDefaultComparator

    public java.util.Comparator getDefaultComparator()

#### getComparator

    public java.util.Comparator getComparator(java.lang.Class type)

#### getElementReader

    public TupleSerialization.SerializationElementReader getElementReader()

Method getElementReader returns the elementReader of this TupleSerialization object.

Returns:
  the elementReader (type SerializationElementReader) of this TupleSerialization object.

#### getElementWriter

    public TupleSerialization.SerializationElementWriter getElementWriter()

Method getElementWriter returns the elementWriter of this TupleSerialization object.

Returns:
  the elementWriter (type SerializationElementWriter) of this TupleSerialization object.

#### accept

    public boolean accept(java.lang.Class c)

Method accept implements `Serialization.accept(Class)`.

Specified by:
  `accept` in interface `org.apache.hadoop.io.serializer.Serialization`
Parameters:
  `c` - of type Class
Returns:
  boolean

#### getDeserializer

    public org.apache.hadoop.io.serializer.Deserializer getDeserializer(java.lang.Class c)

Method getDeserializer implements `Serialization.getDeserializer(Class)`.

Specified by:
  `getDeserializer` in interface `org.apache.hadoop.io.serializer.Serialization`
Parameters:
  `c` - of type Class
Returns:
  Deserializer

#### getSerializer

    public org.apache.hadoop.io.serializer.Serializer getSerializer(java.lang.Class c)

Method getSerializer implements `Serialization.getSerializer(Class)`.

Specified by:
  `getSerializer` in interface `org.apache.hadoop.io.serializer.Serialization`
Parameters:
  `c` - of type Class
Returns:
  Serializer

#### getClass

    public java.lang.Class getClass(java.lang.String className)

#### getFields

    public static java.util.Map<java.lang.Integer,Fields> getFields(org.apache.hadoop.conf.Configuration conf,
                                                    java.lang.String property)