cascading.tuple

## Class TupleEntrySchemeCollector<Config,Output>

- java.lang.Object
- - cascading.tuple.TupleEntryCollector
  - - cascading.tuple.TupleEntrySchemeCollector<Config,Output>

- All Implemented Interfaces:
    AutoCloseable

      public class TupleEntrySchemeCollector<Config,Output>
      extends TupleEntryCollector

  Class TupleEntrySchemeCollector is a helper class for wrapping a `Scheme` instance, calling `Scheme.sink(cascading.flow.FlowProcess, cascading.scheme.SinkCall)` on every call to `add(TupleEntry)` or `add(Tuple)`.

  Use this class inside a custom `Tap` when overriding the `Tap.openForWrite(cascading.flow.FlowProcess)` method.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ConcreteCall<Object,Output>` | `sinkCall`

    - ### Fields inherited from class cascading.tuple.TupleEntryCollector

      `tupleEntry`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess, Scheme scheme)` Deprecated.
    `TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess, Scheme scheme, Output output)` Deprecated.
    `TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess, Scheme scheme, Output output, String loggableIdentifier)` Deprecated.
    `TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess, Scheme scheme, String loggableIdentifier)` Deprecated.
    `TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess, Tap tap, Output output)`
    `TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess, Tap tap, Scheme scheme)`
    `TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess, Tap tap, Scheme scheme, Output output)`
    `TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess, Tap tap, Scheme scheme, Output output, String loggableIdentifier)`
    `TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess, Tap tap, Scheme scheme, String loggableIdentifier)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(Tuple tuple)` Method add inserts the given `Tuple` into the outgoing stream.
    `void` | `add(TupleEntry tupleEntry)` Method add inserts the given `TupleEntry` into the outgoing stream.
    `void` | `close()` Method close closes the underlying resource being written to.
    `protected void` | `collect(TupleEntry tupleEntry)`
    `protected FlowProcess<? extends Config>` | `getFlowProcess()`
    `protected Output` | `getOutput()`
    `protected void` | `prepare()` Need to defer preparing the scheme till after the fields have been resolved
    `void` | `setFields(Fields declared)`
    `protected void` | `setOutput(Output output)`
    `protected Output` | `wrapOutput(Output output)`

    - ### Methods inherited from class cascading.tuple.TupleEntryCollector

      `addTuple, addTupleEntry`

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

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

- - ### Field Detail

    - #### sinkCall

          protected final ConcreteCall<Object,Output> sinkCall

  - ### Constructor Detail

    - #### TupleEntrySchemeCollector

          @Deprecated
          public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                                                       Scheme scheme)

      Deprecated.

    - #### TupleEntrySchemeCollector

          @Deprecated
          public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                                                       Scheme scheme,
                                                       String loggableIdentifier)

      Deprecated.

    - #### TupleEntrySchemeCollector

          @Deprecated
          public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                                                       Scheme scheme,
                                                       Output output)

      Deprecated.

    - #### TupleEntrySchemeCollector

          public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                                           Tap tap,
                                           Output output)

    - #### TupleEntrySchemeCollector

          @Deprecated
          public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                                                       Scheme scheme,
                                                       Output output,
                                                       String loggableIdentifier)

      Deprecated.
      Parameters:
        `flowProcess` -
        `scheme` -
        `output` -
        `loggableIdentifier` - is only used for logging purposes

    - #### TupleEntrySchemeCollector

          public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                                           Tap tap,
                                           Scheme scheme)

    - #### TupleEntrySchemeCollector

          public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                                           Tap tap,
                                           Scheme scheme,
                                           String loggableIdentifier)

    - #### TupleEntrySchemeCollector

          public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                                           Tap tap,
                                           Scheme scheme,
                                           Output output)

    - #### TupleEntrySchemeCollector

          public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                                           Tap tap,
                                           Scheme scheme,
                                           Output output,
                                           String loggableIdentifier)

      Parameters:
        `flowProcess` -
        `scheme` -
        `output` -
        `loggableIdentifier` - is only used for logging purposes

  - ### Method Detail

    - #### getFlowProcess

          protected FlowProcess<? extends Config> getFlowProcess()

    - #### setFields

          public void setFields(Fields declared)

      Overrides:
        `setFields` in class `TupleEntryCollector`

    - #### getOutput

          protected Output getOutput()

    - #### setOutput

          protected void setOutput(Output output)

    - #### wrapOutput

          protected Output wrapOutput(Output output)

    - #### prepare

          protected void prepare()

      Need to defer preparing the scheme till after the fields have been resolved

    - #### add

          public void add(TupleEntry tupleEntry)

      Description copied from class: `TupleEntryCollector`
      Method add inserts the given `TupleEntry` into the outgoing stream. Note the method `TupleEntryCollector.add(Tuple)` is more efficient as it simply calls `TupleEntry.getTuple()`;

      See `TupleEntryCollector` on when and how to re-use a Tuple instance.
      Overrides:
        `add` in class `TupleEntryCollector`
      Parameters:
        `tupleEntry` - of type TupleEntry

    - #### add

          public void add(Tuple tuple)

      Description copied from class: `TupleEntryCollector`
      Method add inserts the given `Tuple` into the outgoing stream.

      See `TupleEntryCollector` on when and how to re-use a Tuple instance.
      Overrides:
        `add` in class `TupleEntryCollector`
      Parameters:
        `tuple` - of type Tuple

    - #### collect

          protected void collect(TupleEntry tupleEntry)
                          throws IOException

      Specified by:
        `collect` in class `TupleEntryCollector`
      Throws:
        `IOException`

    - #### close

          public void close()

      Description copied from class: `TupleEntryCollector`
      Method close closes the underlying resource being written to.

      This method should be called when when an instance is returned via `Tap.openForWrite(cascading.flow.FlowProcess)` and no more `Tuple` instances will be written out.

      This method must not be called when an instance is returned from `getOutputCollector()` from any of the relevant `OperationCall` implementations (inside a Function, Aggregator, or Buffer).
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `TupleEntryCollector`

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