cascading.scheme.hadoop

## Class WritableSequenceFile

- java.lang.Object
- - cascading.scheme.Scheme<Configuration,RecordReader,OutputCollector,java.lang.Object[],java.lang.Void>
  - - cascading.scheme.hadoop.SequenceFile
    - - cascading.scheme.hadoop.WritableSequenceFile

- All Implemented Interfaces:
    Traceable, java.io.Serializable

      public class WritableSequenceFile
      extends SequenceFile

  Class WritableSequenceFile is a sub-class of `SequenceFile` that reads and writes values of the given `writableType` `Class`, instead of `Tuple` instances used by default in SequenceFile.

  This Class is a convenience for those who need to read/write specific types from existing sequence files without them being wrapped in a Tuple instance.

  Note due to the nature of sequence files, only one type can be stored in the key and value positions, they they can be uniquely different types (LongWritable, Text).

  If keyType is null, valueType must not be null, and vice versa, assuming you only wish to store a single value.

  `NullWritable` is used as the empty type for either a null keyType or valueType.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.Class<? extends Writable>` | `keyType`
    `protected java.lang.Class<? extends Writable>` | `valueType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WritableSequenceFile(Fields fields, java.lang.Class<? extends Writable> valueType)` Constructor WritableSequenceFile creates a new WritableSequenceFile instance.
    `WritableSequenceFile(Fields fields, java.lang.Class<? extends Writable> keyType, java.lang.Class<? extends Writable> valueType)` Constructor WritableSequenceFile creates a new WritableSequenceFile instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object object)`
    `int` | `hashCode()`
    `void` | `sink(FlowProcess<? extends Configuration> flowProcess, SinkCall<java.lang.Void,OutputCollector> sinkCall)`
    `void` | `sinkConfInit(FlowProcess<? extends Configuration> flowProcess, Tap<Configuration,RecordReader,OutputCollector> tap, Configuration conf)`
    `boolean` | `source(FlowProcess<? extends Configuration> flowProcess, SourceCall<java.lang.Object[],RecordReader> sourceCall)`

    - ### Methods inherited from class cascading.scheme.hadoop.SequenceFile

      `sourceCleanup, sourceConfInit, sourcePrepare`

    - ### Methods inherited from class cascading.scheme.Scheme

      `getNumSinkParts, getSinkFields, getSourceFields, getTrace, isSink, isSource, isSymmetrical, presentSinkFields, presentSinkFieldsInternal, presentSourceFields, presentSourceFieldsInternal, retrieveSinkFields, retrieveSourceFields, setNumSinkParts, setSinkFields, setSourceFields, sinkCleanup, sinkPrepare, sourceRePrepare, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### keyType

          protected final java.lang.Class<? extends Writable> keyType

    - #### valueType

          protected final java.lang.Class<? extends Writable> valueType

  - ### Constructor Detail

    - #### WritableSequenceFile

          @ConstructorProperties(value={"fields","valueType"})
          public WritableSequenceFile(Fields fields,
                                                    java.lang.Class<? extends Writable> valueType)

      Constructor WritableSequenceFile creates a new WritableSequenceFile instance.
      Parameters:
        `fields` - of type Fields
        `valueType` - of type Class, may not be null

    - #### WritableSequenceFile

          @ConstructorProperties(value={"fields","keyType","valueType"})
          public WritableSequenceFile(Fields fields,
                                                    java.lang.Class<? extends Writable> keyType,
                                                    java.lang.Class<? extends Writable> valueType)

      Constructor WritableSequenceFile creates a new WritableSequenceFile instance.
      Parameters:
        `fields` - of type Fields
        `keyType` - of type Class
        `valueType` - of type Class

  - ### Method Detail

    - #### sinkConfInit

          public void sinkConfInit(FlowProcess<? extends Configuration> flowProcess,
                          Tap<Configuration,RecordReader,OutputCollector> tap,
                          Configuration conf)

      Overrides:
        `sinkConfInit` in class `SequenceFile`

    - #### source

          public boolean source(FlowProcess<? extends Configuration> flowProcess,
                       SourceCall<java.lang.Object[],RecordReader> sourceCall)
                         throws java.io.IOException

      Overrides:
        `source` in class `SequenceFile`
      Throws:
        `java.io.IOException`

    - #### sink

          public void sink(FlowProcess<? extends Configuration> flowProcess,
                  SinkCall<java.lang.Void,OutputCollector> sinkCall)
                    throws java.io.IOException

      Overrides:
        `sink` in class `SequenceFile`
      Throws:
        `java.io.IOException`

    - #### equals

          public boolean equals(java.lang.Object object)

      Overrides:
        `equals` in class `Scheme<Configuration,RecordReader,OutputCollector,java.lang.Object[],java.lang.Void>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Scheme<Configuration,RecordReader,OutputCollector,java.lang.Object[],java.lang.Void>`

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