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
    Modifier and Type | Class and Description
    --- | ---
    `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
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(Class c)` Method accept implements `Serialization.accept(Class)`.
    `boolean` | `areTypesIgnored()`
    `boolean` | `areTypesRequired()`
    `Class` | `getClass(String className)`
    `Comparator` | `getComparator(Class type)`
    `org.apache.hadoop.conf.Configuration` | `getConf()`
    `Comparator` | `getDefaultComparator()`
    `static Comparator` | `getDefaultComparator(Comparator comparator, org.apache.hadoop.conf.Configuration jobConf)`
    `static Comparator` | `getDefaultComparator(org.apache.hadoop.conf.Configuration jobConf)`
    `org.apache.hadoop.io.serializer.Deserializer` | `getDeserializer(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 Map<Integer,Fields>` | `getFields(org.apache.hadoop.conf.Configuration conf, String property)`
    `Integer` | `getFirstOrdinal()`
    `Fields` | `getKeyFields()`
    `Map<Integer,Fields>` | `getKeyFieldsMap()`
    `Map<Integer,Class[]>` | `getKeyTypeMap()`
    `Class[]` | `getKeyTypes()`
    `Fields` | `getMaskedValueFields()`
    `Map<Integer,Class[]>` | `getMaskedValueTypeMap()`
    `List<Integer>` | `getOrdinals()`
    `org.apache.hadoop.io.serializer.Serializer` | `getSerializer(Class c)` Method getSerializer implements `Serialization.getSerializer(Class)`.
    `Fields` | `getSortFields()`
    `Map<Integer,Fields>` | `getSortFieldsMap()`
    `Class[]` | `getSortTypes()`
    `Class[]` | `getTypesFor(Fields fields)`
    `Fields` | `getValueFields()`
    `Map<Integer,Fields>` | `getValueFieldsMap()`
    `Map<Integer,Class[]>` | `getValueTypeMap()`
    `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 Comparator getDefaultComparator(Comparator comparator,
                                        org.apache.hadoop.conf.Configuration jobConf)

    - #### getDefaultComparator

          public static 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 Class[] getKeyTypes()

    - #### getTypesFor

          public Class[] getTypesFor(Fields fields)

    - #### getSortFields

          public Fields getSortFields()

    - #### getSortTypes

          public Class[] getSortTypes()

    - #### getValueFields

          public Fields getValueFields()

    - #### getMaskedValueFields

          public Fields getMaskedValueFields()

    - #### getValueTypes

          public Class[] getValueTypes()

    - #### getKeyTypeMap

          public Map<Integer,Class[]> getKeyTypeMap()

    - #### getValueTypeMap

          public Map<Integer,Class[]> getValueTypeMap()

    - #### getMaskedValueTypeMap

          public Map<Integer,Class[]> getMaskedValueTypeMap()

    - #### getOrdinals

          public List<Integer> getOrdinals()

    - #### getFirstOrdinal

          public Integer getFirstOrdinal()

    - #### getKeyFieldsMap

          public Map<Integer,Fields> getKeyFieldsMap()

    - #### getSortFieldsMap

          public Map<Integer,Fields> getSortFieldsMap()

    - #### getValueFieldsMap

          public Map<Integer,Fields> getValueFieldsMap()

    - #### getDefaultComparator

          public Comparator getDefaultComparator()

    - #### getComparator

          public Comparator getComparator(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(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(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(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 Class getClass(String className)

    - #### getFields

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

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