public class PartitionTap extends BasePartitionTap<Properties,InputStream,OutputStream>
Tuple
instance.
The constructor takes a FileTap
Tap
and a Partition
implementation. This allows Tuple values at given positions to be used as directory names during write
operations, and directory names as data during read operations.
The key value here is that there is no need to duplicate data values in the directory names and inside
the data files.
So only values declared in the parent Tap will be read or written to the underlying file system files. But
fields declared by the Partition
will only be read or written to the directory names. That is, the
PartitionTap instance will sink or source the partition fields, plus the parent Tap fields. The partition
fields and parent Tap fields do not need to have common field names.
openWritesThreshold
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.
PartitionTap will populate a given partition
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 a custom Partition implementation or an upstream
Function
is recommended, see expression.ExpressionFunction
.BasePartitionTap.Counters, BasePartitionTap.PartitionCollector, BasePartitionTap.PartitionScheme<Config,Input,Output>
keepParentOnDelete, OPEN_WRITES_THRESHOLD_DEFAULT, openWritesThreshold, parent, partition, sourcePartitionFilters
Constructor and Description |
---|
PartitionTap(FileTap parent,
Partition partition)
|
PartitionTap(FileTap parent,
Partition partition,
int openWritesThreshold)
|
PartitionTap(FileTap parent,
Partition partition,
SinkMode sinkMode)
|
PartitionTap(FileTap parent,
Partition partition,
SinkMode sinkMode,
boolean keepParentOnDelete)
|
PartitionTap(FileTap parent,
Partition partition,
SinkMode sinkMode,
boolean keepParentOnDelete,
int openWritesThreshold)
|
Modifier and Type | Method and Description |
---|---|
protected TupleEntrySchemeCollector |
createTupleEntrySchemeCollector(FlowProcess<? extends Properties> flowProcess,
Tap parent,
String path,
long sequence) |
protected TupleEntrySchemeIterator |
createTupleEntrySchemeIterator(FlowProcess<? extends Properties> flowProcess,
Tap parent,
String path,
InputStream input) |
boolean |
deleteResource(Properties conf) |
protected String |
getCurrentIdentifier(FlowProcess<? extends Properties> flowProcess) |
addSourcePartitionFilter, commitResource, createResource, equals, getChildPartitionIdentifiers, getFilteredPartitionIdentifiers, getIdentifier, getModifiedTime, getOpenWritesThreshold, getParent, getPartition, hashCode, openForRead, openForWrite, prepareResourceForRead, prepareResourceForWrite, resourceExists, rollbackResource, toString
createResource, deleteResource, flowConfInit, getConfigDef, getFullIdentifier, getFullIdentifier, getModifiedTime, getNodeConfigDef, getScheme, getSinkFields, getSinkMode, getSourceFields, getStepConfigDef, getTrace, hasConfigDef, hasNodeConfigDef, hasStepConfigDef, id, isKeep, isReplace, isSink, isSource, isTemporary, isUpdate, openForRead, openForWrite, outgoingScopeFor, presentSinkFields, presentSourceFields, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, resourceExists, retrieveSinkFields, retrieveSourceFields, setScheme, sinkConfInit, sourceConfInit, taps
@ConstructorProperties(value={"parent","partition"}) public PartitionTap(FileTap parent, Partition partition)
FileTap
Tap as the
base path and default Scheme
, and the partition.parent
- of type Tappartition
- of type Partition@ConstructorProperties(value={"parent","partition","openWritesThreshold"}) public PartitionTap(FileTap parent, Partition partition, int openWritesThreshold)
FileTap
Tap as the
base path and default Scheme
, and the partition.
openWritesThreshold
limits the number of open files to be output to.parent
- of type Hfspartition
- of type PartitionopenWritesThreshold
- of type int@ConstructorProperties(value={"parent","partition","sinkMode"}) public PartitionTap(FileTap parent, Partition partition, SinkMode sinkMode)
FileTap
Tap as the
base path and default Scheme
, and the partition.parent
- of type Tappartition
- of type PartitionsinkMode
- of type SinkMode@ConstructorProperties(value={"parent","partition","sinkMode","keepParentOnDelete"}) public PartitionTap(FileTap parent, Partition partition, SinkMode sinkMode, boolean keepParentOnDelete)
FileTap
Tap as the
base path and default Scheme
, and the partition.
keepParentOnDelete
, when set to true, prevents the parent Tap from being deleted when BasePartitionTap.deleteResource(Object)
is called, typically an issue when used inside a Cascade
.parent
- of type Tappartition
- of type PartitionsinkMode
- of type SinkModekeepParentOnDelete
- of type boolean@ConstructorProperties(value={"parent","partition","sinkMode","keepParentOnDelete","openWritesThreshold"}) public PartitionTap(FileTap parent, Partition partition, SinkMode sinkMode, boolean keepParentOnDelete, int openWritesThreshold)
FileTap
Tap as the
base path and default Scheme
, and the partition.
keepParentOnDelete
, when set to true, prevents the parent Tap from being deleted when BasePartitionTap.deleteResource(Object)
is called, typically an issue when used inside a Cascade
.
openWritesThreshold
limits the number of open files to be output to.parent
- of type Tappartition
- of type PartitionsinkMode
- of type SinkModekeepParentOnDelete
- of type booleanopenWritesThreshold
- of type intprotected String getCurrentIdentifier(FlowProcess<? extends Properties> flowProcess)
getCurrentIdentifier
in class BasePartitionTap<Properties,InputStream,OutputStream>
public boolean deleteResource(Properties conf) throws IOException
deleteResource
in class BasePartitionTap<Properties,InputStream,OutputStream>
IOException
protected TupleEntrySchemeCollector createTupleEntrySchemeCollector(FlowProcess<? extends Properties> flowProcess, Tap parent, String path, long sequence) throws IOException
createTupleEntrySchemeCollector
in class BasePartitionTap<Properties,InputStream,OutputStream>
IOException
protected TupleEntrySchemeIterator createTupleEntrySchemeIterator(FlowProcess<? extends Properties> flowProcess, Tap parent, String path, InputStream input) throws FileNotFoundException
createTupleEntrySchemeIterator
in class BasePartitionTap<Properties,InputStream,OutputStream>
FileNotFoundException
Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.