cascading.tap.partition

## Class DelimitedPartition

- java.lang.Object
- - cascading.tap.partition.DelimitedPartition

- All Implemented Interfaces:
    Partition, Serializable

      public class DelimitedPartition
      extends Object
      implements Partition

  DelimitedPartition is an implementation of the `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.

  The postfix value will be appended to any partition when created, and removed when the partition is parsed. Use this value to add static filenames to the output path. It is safe to include the delimiter in the postfix value (e.g '/somepath/filename.csv' where the delimiter is the default '/').

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PATH_DELIM`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DelimitedPartition(Fields partitionFields)`
    `DelimitedPartition(Fields partitionFields, String delimiter)`
    `DelimitedPartition(Fields partitionFields, String delimiter, String postfix)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getDelimiter()`
    `Fields` | `getPartitionFields()` The `Fields` used to populate the partition.
    `int` | `getPathDepth()` Returns the directory search depth of the partition.
    `protected Pattern` | `getPattern()`
    `String` | `getPostfix()`
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PATH_DELIM

          public static final String PATH_DELIM

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DelimitedPartition

          public DelimitedPartition(Fields partitionFields)

    - #### DelimitedPartition

          public DelimitedPartition(Fields partitionFields,
                                    String delimiter)

    - #### DelimitedPartition

          public DelimitedPartition(Fields partitionFields,
                                    String delimiter,
                                    String postfix)

  - ### Method Detail

    - #### getPathDepth

          public int getPathDepth()

      Description copied from interface: `Partition`
      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.
      Specified by:
        `getPathDepth` in interface `Partition`
      Returns:
        an int

    - #### getPartitionFields

          public Fields getPartitionFields()

      Description copied from interface: `Partition`
      The `Fields` used to populate the partition.
      Specified by:
        `getPartitionFields` in interface `Partition`
      Returns:
        a Fields instance

    - #### getPattern

          protected Pattern getPattern()

    - #### getDelimiter

          public String getDelimiter()

    - #### getPostfix

          public String getPostfix()

    - #### toTuple

          public void toTuple(String partition,
                              TupleEntry tupleEntry)

      Description copied from interface: `Partition`
      Converts the given partition String to a `TupleEntry` using the given TupleEntry instance for re-use.
      Specified by:
        `toTuple` in interface `Partition`
      Parameters:
        `partition` - a String
        `tupleEntry` - a TupleEntry

    - #### toPartition

          public String toPartition(TupleEntry tupleEntry)

      Description copied from interface: `Partition`
      Converts the given tupleEntry into a partition string.
      Specified by:
        `toPartition` in interface `Partition`
      Parameters:
        `tupleEntry` - a TupleEntry
      Returns:
        a String

Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.