@Deprecated public class TemplateTap extends BaseTemplateTap<org.apache.hadoop.mapred.JobConf,org.apache.hadoop.mapred.OutputCollector>
Tuple
instance.
The constructor takes a Hfs
Tap
and a Formatter
format syntax String. This allows
Tuple values at given positions to be used as directory names. Note that Hadoop can only sink to directories, and
all files in those directories are "part-xxxxx" files.
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
.
Though Hadoop has no mechanism to prevent simultaneous writes to a directory from multiple jobs, it doesn't mean
its safe to do so. Same is true with the TemplateTap. Interleaving writes to a common parent (root) directory
across multiple flows will very likely lead to data loss.BaseTemplateTap.Counters, BaseTemplateTap.TemplateScheme<Config,Output>
keepParentOnDelete, OPEN_TAPS_THRESHOLD_DEFAULT, openTapsThreshold, parent, pathTemplate
Constructor and Description |
---|
TemplateTap(Hfs parent,
java.lang.String pathTemplate)
Deprecated.
|
TemplateTap(Hfs parent,
java.lang.String pathTemplate,
Fields pathFields)
Deprecated.
|
TemplateTap(Hfs parent,
java.lang.String pathTemplate,
Fields pathFields,
int openTapsThreshold)
Deprecated.
|
TemplateTap(Hfs parent,
java.lang.String pathTemplate,
Fields pathFields,
SinkMode sinkMode)
Deprecated.
|
TemplateTap(Hfs parent,
java.lang.String pathTemplate,
Fields pathFields,
SinkMode sinkMode,
boolean keepParentOnDelete)
Deprecated.
|
TemplateTap(Hfs parent,
java.lang.String pathTemplate,
Fields pathFields,
SinkMode sinkMode,
boolean keepParentOnDelete,
int openTapsThreshold)
Deprecated.
|
TemplateTap(Hfs parent,
java.lang.String pathTemplate,
int openTapsThreshold)
Deprecated.
|
TemplateTap(Hfs parent,
java.lang.String pathTemplate,
SinkMode sinkMode)
Deprecated.
|
TemplateTap(Hfs parent,
java.lang.String pathTemplate,
SinkMode sinkMode,
boolean keepParentOnDelete)
Deprecated.
|
TemplateTap(Hfs parent,
java.lang.String pathTemplate,
SinkMode sinkMode,
boolean keepParentOnDelete,
int openTapsThreshold)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected TupleEntrySchemeCollector |
createTupleEntrySchemeCollector(FlowProcess<org.apache.hadoop.mapred.JobConf> flowProcess,
Tap parent,
java.lang.String path)
Deprecated.
|
commitResource, createResource, deleteResource, equals, getIdentifier, getModifiedTime, getOpenTapsThreshold, getParent, getPathTemplate, hashCode, openForWrite, resourceExists, rollbackResource, toString
getSourceFields, isSource, openForRead, sourceConfInit
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
@ConstructorProperties(value={"parent","pathTemplate"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate)
Hfs
Tap as the
base path and default Scheme
, and the pathTemplate as the Formatter
format String.parent
- of type TappathTemplate
- of type String@ConstructorProperties(value={"parent","pathTemplate","openTapsThreshold"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate, int openTapsThreshold)
Hfs
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.parent
- of type HfspathTemplate
- of type StringopenTapsThreshold
- of type int@ConstructorProperties(value={"parent","pathTemplate","sinkMode"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate, SinkMode sinkMode)
Hfs
Tap as the
base path and default Scheme
, and the pathTemplate as the Formatter
format String.parent
- of type TappathTemplate
- of type StringsinkMode
- of type SinkMode@ConstructorProperties(value={"parent","pathTemplate","sinkMode","keepParentOnDelete"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate, SinkMode sinkMode, boolean keepParentOnDelete)
Hfs
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
.parent
- of type TappathTemplate
- of type StringsinkMode
- of type SinkModekeepParentOnDelete
- of type boolean@ConstructorProperties(value={"parent","pathTemplate","sinkMode","keepParentOnDelete","openTapsThreshold"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate, SinkMode sinkMode, boolean keepParentOnDelete, int openTapsThreshold)
Hfs
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.parent
- of type TappathTemplate
- of type StringsinkMode
- of type SinkModekeepParentOnDelete
- of type booleanopenTapsThreshold
- of type int@ConstructorProperties(value={"parent","pathTemplate","pathFields"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate, Fields pathFields)
Hfs
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.parent
- of type TappathTemplate
- of type StringpathFields
- of type Fields@ConstructorProperties(value={"parent","pathTemplate","pathFields","openTapsThreshold"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate, Fields pathFields, int openTapsThreshold)
Hfs
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.parent
- of type HfspathTemplate
- of type StringpathFields
- of type FieldsopenTapsThreshold
- of type int@ConstructorProperties(value={"parent","pathTemplate","pathFields","sinkMode"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate, Fields pathFields, SinkMode sinkMode)
Hfs
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.parent
- of type TappathTemplate
- of type StringpathFields
- of type FieldssinkMode
- of type SinkMode@ConstructorProperties(value={"parent","pathTemplate","pathFields","sinkMode","keepParentOnDelete"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate, Fields pathFields, SinkMode sinkMode, boolean keepParentOnDelete)
Hfs
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
.parent
- of type TappathTemplate
- of type StringpathFields
- of type FieldssinkMode
- of type SinkModekeepParentOnDelete
- of type boolean@ConstructorProperties(value={"parent","pathTemplate","pathFields","sinkMode","keepParentOnDelete","openTapsThreshold"}) public TemplateTap(Hfs parent, java.lang.String pathTemplate, Fields pathFields, SinkMode sinkMode, boolean keepParentOnDelete, int openTapsThreshold)
Hfs
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.parent
- of type HfspathTemplate
- of type StringpathFields
- of type FieldssinkMode
- of type SinkModekeepParentOnDelete
- of type booleanopenTapsThreshold
- of type intprotected TupleEntrySchemeCollector createTupleEntrySchemeCollector(FlowProcess<org.apache.hadoop.mapred.JobConf> flowProcess, Tap parent, java.lang.String path) throws java.io.IOException
createTupleEntrySchemeCollector
in class BaseTemplateTap<org.apache.hadoop.mapred.JobConf,org.apache.hadoop.mapred.OutputCollector>
java.io.IOException