cascading.tap.partition
Interface Partition

All Superinterfaces:
Serializable
All Known Implementing Classes:
DelimitedPartition

public interface Partition
extends Serializable

The Partition interface allows for custom partitioning mechanisms to be created with the BasePartitionTap sub-classes.

A partition is a directory on a filesystem, where the directory contains data related to the files underneath the partition directory.

For example, a partition could be "2012/09/01", which would contain log files for that day.


Method Summary
 Fields getPartitionFields()
          The Fields used to populate the partition.
 int getPathDepth()
          Returns the directory search depth of the partition.
 String toPartition(TupleEntry tupleEntry)
          Converts the given tupleEntry into a partition string.
 void toTuple(String partition, TupleEntry tupleEntry)
          Converts the given partition String to a TupleEntry using the given TupleEntry instance for re-use.
 

Method Detail

getPathDepth

int getPathDepth()
Returns the directory search depth of the partition.

For example, a Partition implementation that returns values like "2012/09/01" would have a depth of 3.

Returns:
an int

getPartitionFields

Fields getPartitionFields()
The Fields used to populate the partition.

Returns:
a Fields instance

toTuple

void toTuple(String partition,
             TupleEntry tupleEntry)
Converts the given partition String to a TupleEntry using the given TupleEntry instance for re-use.

Parameters:
partition - a String
tupleEntry - a TupleEntry

toPartition

String toPartition(TupleEntry tupleEntry)
Converts the given tupleEntry into a partition string.

Parameters:
tupleEntry - a TupleEntry
Returns:
a String


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