## cascading.tuple.hadoop
Class TupleSerialization

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

All Implemented Interfaces:
  Configurable, Serialization

    public class TupleSerialization

extends Configured
implements 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 `JobConf`.

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

Constructor Summary
`TupleSerialization()` Constructor TupleSerialization creates a new TupleSerialization instance.
`TupleSerialization(Configuration conf)` Constructor TupleSerialization creates a new TupleSerialization instance.

Method Summary
`boolean` `accept(Class c)` Method accept implements `Serialization.accept(Class)`.
`static void` `addSerialization(Map<Object,Object> properties, String className)` Adds the given className as a Hadoop IO serialization class.
`static void` `addSerializationToken(Map<Object,Object> properties, int token, String className)` Adds the given token and className pair as a serialization token property.
`Class` `getClass(String className)`
`Comparator` `getComparator(Class type)`
`Configuration` `getConf()`
`Deserializer` `getDeserializer(Class c)` Method getDeserializer implements `Serialization.getDeserializer(Class)`.
`SerializationElementReader` `getElementReader()` Method getElementReader returns the elementReader of this TupleSerialization object.
`SerializationElementWriter` `getElementWriter()` Method getElementWriter returns the elementWriter of this TupleSerialization object.
`static String` `getSerializationTokens(Map<Object,Object> properties)` Returns the serialization tokens property.
`Serializer` `getSerializer(Class c)` Method getSerializer implements `Serialization.getSerializer(Class)`.
`static void` `setSerializations(JobConf jobConf)` Adds this class as a Hadoop Serialization class.

Methods inherited from class org.apache.hadoop.conf.Configured
`setConf`

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(Configuration conf)

  Constructor TupleSerialization creates a new TupleSerialization instance.

  Parameters:
    `conf` - of type Configuration

Method Detail

### addSerializationToken

    public static void addSerializationToken(Map<Object,Object> properties,
                                             int token,
                                             String className)

  Adds the given token and className pair as a serialization token property. During object serialization and deserialization, the given token will be used instead of the className when an instance of the className is encountered.

  Parameters:
    `properties` - of type Map
    `token` - of type int
    `className` - of type String

### getSerializationTokens

    public static String getSerializationTokens(Map<Object,Object> properties)

  Returns the serialization tokens property.

  Parameters:
    `properties` - of type Map
  Returns:
    returns a String

### addSerialization

    public static void addSerialization(Map<Object,Object> properties,
                                        String className)

  Adds the given className as a Hadoop IO serialization class.

  Parameters:
    `properties` - of type Map
    `className` - of type String

### setSerializations

    public static void setSerializations(JobConf jobConf)

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

  Parameters:
    `jobConf` - of type JobConf

### getConf

    public Configuration getConf()

  Specified by:
    `getConf` in interface `Configurable`
  Overrides:
    `getConf` in class `Configured`

### getComparator

    public Comparator getComparator(Class type)

### getElementReader

    public SerializationElementReader getElementReader()

  Method getElementReader returns the elementReader of this TupleSerialization object.

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

### getElementWriter

    public SerializationElementWriter getElementWriter()

  Method getElementWriter returns the elementWriter of this TupleSerialization object.

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

### accept

    public boolean accept(Class c)

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

  Specified by:
    `accept` in interface `Serialization`
  Parameters:
    `c` - of type Class
  Returns:
    boolean

### getDeserializer

    public Deserializer getDeserializer(Class c)

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

  Specified by:
    `getDeserializer` in interface `Serialization`
  Parameters:
    `c` - of type Class
  Returns:
    Deserializer

### getSerializer

    public Serializer getSerializer(Class c)

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

  Specified by:
    `getSerializer` in interface `Serialization`
  Parameters:
    `c` - of type Class
  Returns:
    Serializer

### getClass

    public Class getClass(String className)

Copyright © 2007-2010 Concurrent, Inc. All Rights Reserved.