Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cascading.tap.local
Class TemplateTap

    java.lang.Object
      cascading.tap.Tap<Config,Void,Output>
          cascading.tap.SinkTap<Config,Output>
              cascading.tap.BaseTemplateTap<Properties,OutputStream>
                  cascading.tap.local.TemplateTap

All Implemented Interfaces:
  FlowElement, Serializable

    public class TemplateTap

extends BaseTemplateTap<Properties,OutputStream>

Class TemplateTap can be used to write tuple streams out to files and sub-directories based on the values in the `Tuple` instance.

The constructor takes a `FileTap` `Tap` and a `Formatter` format syntax String. This allows Tuple values at given positions to be used as directory names.

`openTapsThreshold` limits the number of open files to be output to. This value defaults to 300 files. Each time the threshold is exceeded, 10% of the least recently used open files will be closed.

TemplateTap will populate a given `pathTemplate` without regard to case of the values being used. Thus the resulting paths `2012/June/` and `2012/june/` will likely result in two open files into the same location. Forcing the case to be consistent with an upstream `Function` is recommended, see `ExpressionFunction`.

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class cascading.tap.BaseTemplateTap
`BaseTemplateTap.Counters, BaseTemplateTap.TemplateScheme<Config,Output>`

Field Summary

Fields inherited from class cascading.tap.BaseTemplateTap
`keepParentOnDelete, OPEN_TAPS_THRESHOLD_DEFAULT, openTapsThreshold, parent, pathTemplate`

Constructor Summary
`TemplateTap(FileTap parent, String pathTemplate)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.
`TemplateTap(FileTap parent, String pathTemplate, Fields pathFields)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.
`TemplateTap(FileTap parent, String pathTemplate, Fields pathFields, int openTapsThreshold)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.
`TemplateTap(FileTap parent, String pathTemplate, Fields pathFields, SinkMode sinkMode)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.
`TemplateTap(FileTap parent, String pathTemplate, Fields pathFields, SinkMode sinkMode, boolean keepParentOnDelete)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.
`TemplateTap(FileTap parent, String pathTemplate, Fields pathFields, SinkMode sinkMode, boolean keepParentOnDelete, int openTapsThreshold)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.
`TemplateTap(FileTap parent, String pathTemplate, int openTapsThreshold)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.
`TemplateTap(FileTap parent, String pathTemplate, SinkMode sinkMode)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.
`TemplateTap(FileTap parent, String pathTemplate, SinkMode sinkMode, boolean keepParentOnDelete)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.
`TemplateTap(FileTap parent, String pathTemplate, SinkMode sinkMode, boolean keepParentOnDelete, int openTapsThreshold)` Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.

Method Summary
`protected TupleEntrySchemeCollector` | `createTupleEntrySchemeCollector(FlowProcess<Properties> flowProcess, Tap parent, String path)`

Methods inherited from class cascading.tap.BaseTemplateTap
`commitResource, createResource, deleteResource, equals, getIdentifier, getModifiedTime, getOpenTapsThreshold, getParent, getPathTemplate, hashCode, openForWrite, resourceExists, rollbackResource, toString`

Methods inherited from class cascading.tap.SinkTap
`getSourceFields, isSource, openForRead, sourceConfInit`

Methods inherited from class cascading.tap.Tap
`createResource, deleteResource, flowConfInit, getConfigDef, getFullIdentifier, getFullIdentifier, getModifiedTime, getScheme, getSinkFields, getSinkMode, getStepConfigDef, getTrace, hasConfigDef, hasStepConfigDef, id, isEquivalentTo, isKeep, isReplace, isSink, isTemporary, isUpdate, openForRead, openForWrite, outgoingScopeFor, presentSinkFields, presentSourceFields, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, resourceExists, retrieveSinkFields, retrieveSourceFields, setScheme, sinkConfInit, taps`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.

  Parameters:
    `parent` - of type Tap
    `pathTemplate` - of type String

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate","openTapsThreshold"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate,
                                                  int openTapsThreshold)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.

  `openTapsThreshold` limits the number of open files to be output to.

  Parameters:
    `parent` - of type Hfs
    `pathTemplate` - of type String
    `openTapsThreshold` - of type int

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate","sinkMode"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate,
                                                  SinkMode sinkMode)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.

  Parameters:
    `parent` - of type Tap
    `pathTemplate` - of type String
    `sinkMode` - of type SinkMode

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate","sinkMode","keepParentOnDelete"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate,
                                                  SinkMode sinkMode,
                                                  boolean keepParentOnDelete)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.

  `keepParentOnDelete`, when set to true, prevents the parent Tap from being deleted when `BaseTemplateTap.deleteResource(Object)` is called, typically an issue when used inside a `Cascade`.

  Parameters:
    `parent` - of type Tap
    `pathTemplate` - of type String
    `sinkMode` - of type SinkMode
    `keepParentOnDelete` - of type boolean

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate","sinkMode","keepParentOnDelete","openTapsThreshold"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate,
                                                  SinkMode sinkMode,
                                                  boolean keepParentOnDelete,
                                                  int openTapsThreshold)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String.

  `keepParentOnDelete`, when set to true, prevents the parent Tap from being deleted when `BaseTemplateTap.deleteResource(Object)` is called, typically an issue when used inside a `Cascade`.

  `openTapsThreshold` limits the number of open files to be output to.

  Parameters:
    `parent` - of type Tap
    `pathTemplate` - of type String
    `sinkMode` - of type SinkMode
    `keepParentOnDelete` - of type boolean
    `openTapsThreshold` - of type int

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate","pathFields"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate,
                                                  Fields pathFields)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String. The pathFields is a selector that selects and orders the fields to be used in the given pathTemplate.

  This constructor also allows the sinkFields of the parent Tap to be independent of the pathFields. Thus allowing data not in the result file to be used in the template path name.

  Parameters:
    `parent` - of type Tap
    `pathTemplate` - of type String
    `pathFields` - of type Fields

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate","pathFields","openTapsThreshold"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate,
                                                  Fields pathFields,
                                                  int openTapsThreshold)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String. The pathFields is a selector that selects and orders the fields to be used in the given pathTemplate.

  This constructor also allows the sinkFields of the parent Tap to be independent of the pathFields. Thus allowing data not in the result file to be used in the template path name.

  `openTapsThreshold` limits the number of open files to be output to.

  Parameters:
    `parent` - of type Hfs
    `pathTemplate` - of type String
    `pathFields` - of type Fields
    `openTapsThreshold` - of type int

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate","pathFields","sinkMode"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate,
                                                  Fields pathFields,
                                                  SinkMode sinkMode)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String. The pathFields is a selector that selects and orders the fields to be used in the given pathTemplate.

  This constructor also allows the sinkFields of the parent Tap to be independent of the pathFields. Thus allowing data not in the result file to be used in the template path name.

  Parameters:
    `parent` - of type Tap
    `pathTemplate` - of type String
    `pathFields` - of type Fields
    `sinkMode` - of type SinkMode

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate","pathFields","sinkMode","keepParentOnDelete"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate,
                                                  Fields pathFields,
                                                  SinkMode sinkMode,
                                                  boolean keepParentOnDelete)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String. The pathFields is a selector that selects and orders the fields to be used in the given pathTemplate.

  This constructor also allows the sinkFields of the parent Tap to be independent of the pathFields. Thus allowing data not in the result file to be used in the template path name.

  `keepParentOnDelete`, when set to true, prevents the parent Tap from being deleted when `BaseTemplateTap.deleteResource(Object)` is called, typically an issue when used inside a `Cascade`.

  Parameters:
    `parent` - of type Tap
    `pathTemplate` - of type String
    `pathFields` - of type Fields
    `sinkMode` - of type SinkMode
    `keepParentOnDelete` - of type boolean

### TemplateTap

    @ConstructorProperties(value={"parent","pathTemplate","pathFields","sinkMode","keepParentOnDelete","openTapsThreshold"})
    public TemplateTap(FileTap parent,
                                                  String pathTemplate,
                                                  Fields pathFields,
                                                  SinkMode sinkMode,
                                                  boolean keepParentOnDelete,
                                                  int openTapsThreshold)

  Constructor TemplateTap creates a new TemplateTap instance using the given parent `FileTap` Tap as the base path and default `Scheme`, and the pathTemplate as the `Formatter` format String. The pathFields is a selector that selects and orders the fields to be used in the given pathTemplate.

  This constructor also allows the sinkFields of the parent Tap to be independent of the pathFields. Thus allowing data not in the result file to be used in the template path name.

  `keepParentOnDelete`, when set to true, prevents the parent Tap from being deleted when `BaseTemplateTap.deleteResource(Object)` is called, typically an issue when used inside a `Cascade`.

  `openTapsThreshold` limits the number of open files to be output to.

  Parameters:
    `parent` - of type Hfs
    `pathTemplate` - of type String
    `pathFields` - of type Fields
    `sinkMode` - of type SinkMode
    `keepParentOnDelete` - of type boolean
    `openTapsThreshold` - of type int

Method Detail

### createTupleEntrySchemeCollector

    protected TupleEntrySchemeCollector createTupleEntrySchemeCollector(FlowProcess<Properties> flowProcess,
                                                                        Tap parent,
                                                                        String path)
                                                                 throws IOException

  Specified by:
    `createTupleEntrySchemeCollector` in class `BaseTemplateTap<Properties,OutputStream>`
  Throws:
    `IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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