public class DelimitedPartition extends java.lang.Object implements Partition
Partition
interface that allows for simple
text delimited paths as partitions.
For example, given the delimiter -
(dash), a partition path will have dashes.
Note the delimiter must not be naturally present in any of the values making up the partition.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PATH_DELIM |
Constructor and Description |
---|
DelimitedPartition(Fields partitionFields) |
DelimitedPartition(Fields partitionFields,
java.lang.String delimiter) |
Modifier and Type | Method and Description |
---|---|
Fields |
getPartitionFields()
The
Fields used to populate the partition. |
int |
getPathDepth()
Returns the directory search depth of the partition.
|
protected java.util.regex.Pattern |
getPattern() |
java.lang.String |
toPartition(TupleEntry tupleEntry)
Converts the given tupleEntry into a partition string.
|
void |
toTuple(java.lang.String partition,
TupleEntry tupleEntry)
Converts the given partition String to a
TupleEntry using the given TupleEntry instance for re-use. |
public static final java.lang.String PATH_DELIM
public DelimitedPartition(Fields partitionFields, java.lang.String delimiter)
public DelimitedPartition(Fields partitionFields)
public int getPathDepth()
Partition
"2012/09/01"
would have a depth of 3.getPathDepth
in interface Partition
public Fields getPartitionFields()
Partition
Fields
used to populate the partition.getPartitionFields
in interface Partition
protected java.util.regex.Pattern getPattern()
public void toTuple(java.lang.String partition, TupleEntry tupleEntry)
Partition
TupleEntry
using the given TupleEntry instance for re-use.public java.lang.String toPartition(TupleEntry tupleEntry)
Partition
toPartition
in interface Partition
tupleEntry
- a TupleEntryCopyright © 2007-2015 Xplenty, Inc. All Rights Reserved.