org.apache.nutch.segment

## Class SegmentPart

- java.lang.Object
- - org.apache.nutch.segment.SegmentPart

-     public class SegmentPart
      extends java.lang.Object

  Utility class for handling information about segment parts.
  Author:
    Andrzej Bialecki

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `partName` Name of the segment part (ie.
    `java.lang.String` | `segmentName` Name of the segment (just the last path component).

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SegmentPart()`
    `SegmentPart(java.lang.String segmentName, java.lang.String partName)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SegmentPart` | `get(FileSplit split)` Create SegmentPart from a FileSplit.
    `static SegmentPart` | `get(java.lang.String path)` Create SegmentPart from a full path of a location inside any segment part.
    `static SegmentPart` | `parse(java.lang.String string)` Create SegmentPart from a String in format "segmentName/partName".
    `java.lang.String` | `toString()` Return a String representation of this class, in the form "segmentName/partName".

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

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

- - ### Field Detail

    - #### segmentName

          public java.lang.String segmentName

      Name of the segment (just the last path component).

    - #### partName

          public java.lang.String partName

      Name of the segment part (ie. one of subdirectories inside a segment).

  - ### Constructor Detail

    - #### SegmentPart

          public SegmentPart()

    - #### SegmentPart

          public SegmentPart(java.lang.String segmentName,
                             java.lang.String partName)

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Return a String representation of this class, in the form "segmentName/partName".
      Overrides:
        `toString` in class `java.lang.Object`

    - #### get

          public static SegmentPart get(FileSplit split)
                                 throws java.io.IOException

      Create SegmentPart from a FileSplit.
      Parameters:
        `split` -
      Returns:
        A `SegmentPart` resultant from a `FileSplit`.
      Throws:
        `java.io.IOException`

    - #### get

          public static SegmentPart get(java.lang.String path)
                                 throws java.io.IOException

      Create SegmentPart from a full path of a location inside any segment part.
      Parameters:
        `path` - full path into a segment part (may include "part-xxxxx" components)
      Returns:
        SegmentPart instance describing this part.
      Throws:
        `java.io.IOException` - if any required path components are missing.

    - #### parse

          public static SegmentPart parse(java.lang.String string)
                                   throws java.io.IOException

      Create SegmentPart from a String in format "segmentName/partName".
      Parameters:
        `string` - input String
      Returns:
        parsed instance of SegmentPart
      Throws:
        `java.io.IOException` - if "/" is missing.

Copyright © 2019 The Apache Software Foundation