Package org.apache.nutch.segment
Class SegmentPart
- java.lang.Object
-
- org.apache.nutch.segment.SegmentPart
-
public class SegmentPart extends Object
Utility class for handling information about segment parts.- Author:
- Andrzej Bialecki
-
-
Field Summary
Fields Modifier and Type Field Description String
partName
Name of the segment part (ie.String
segmentName
Name of the segment (just the last path component).
-
Constructor Summary
Constructors Constructor Description SegmentPart()
SegmentPart(String segmentName, String partName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SegmentPart
get(String path)
Create SegmentPart from a full path of a location inside any segment part.static SegmentPart
get(FileSplit split)
Create SegmentPart from a FileSplit.static SegmentPart
parse(String string)
Create SegmentPart from a String in format "segmentName/partName".String
toString()
Return a String representation of this class, in the form "segmentName/partName".
-
-
-
Method Detail
-
toString
public String toString()
Return a String representation of this class, in the form "segmentName/partName".
-
get
public static SegmentPart get(FileSplit split) throws IOException
Create SegmentPart from a FileSplit.- Parameters:
split
- aFileSplit
segment part- Returns:
- a
SegmentPart
resultant from aFileSplit
. - Throws:
IOException
- if there is a fatal error locating the split
-
get
public static SegmentPart get(String path) throws 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:
IOException
- if any required path components are missing.
-
parse
public static SegmentPart parse(String string) throws IOException
Create SegmentPart from a String in format "segmentName/partName".- Parameters:
string
- input String- Returns:
- parsed instance of SegmentPart
- Throws:
IOException
- if "/" is missing.
-
-