cascading.tuple

## Class TupleEntrySchemeCollector<Config,Output>

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

Direct Known Subclasses:
  HadoopTupleEntrySchemeCollector

    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
`protected ConcreteCall<java.lang.Object,Output>` `sinkCall`

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

`tupleEntry`

### Constructor Summary

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

### Method Summary

Methods
`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 java.lang.Object

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

### Field Detail

#### sinkCall

    protected final ConcreteCall<java.lang.Object,Output> sinkCall

### Constructor Detail

#### TupleEntrySchemeCollector

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

#### TupleEntrySchemeCollector

    public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                             Scheme scheme,
                             java.lang.String identifier)

#### TupleEntrySchemeCollector

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

#### TupleEntrySchemeCollector

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

#### TupleEntrySchemeCollector

    public TupleEntrySchemeCollector(FlowProcess<? extends Config> flowProcess,
                             Scheme scheme,
                             Output output,
                             java.lang.String identifier)

### 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 java.io.IOException

Specified by:
  `collect` in class `TupleEntryCollector`
Throws:
  `java.io.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).

Overrides:
  `close` in class `TupleEntryCollector`