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 and Description String partName
Name of the segment part (ie.
String segmentName
Name of the segment (just the last path component).
Constructor Summary
Constructors Constructor and Description SegmentPart() SegmentPart(String segmentName,
String partName)
Method Summary
Methods Modifier and Type Method and Description static SegmentPart get(org.apache.hadoop.mapred.FileSplit split)
Create SegmentPart from a FileSplit.
static SegmentPart get(String path)
Create SegmentPart from a full path of a location inside any segment part.
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".
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Field Detail
-
segmentName
public String segmentName
Name of the segment (just the last path component).
-
partName
public String partName
Name of the segment part (ie. one of subdirectories inside a segment).
Constructor Detail
-
SegmentPart
public SegmentPart()
-
SegmentPart
public SegmentPart(String segmentName, String partName)
Method Detail
-
toString
public String toString()
Return a String representation of this class, in the form "segmentName/partName".
- Overrides:
- <code>toString</code> in class <code>Object</code>
-
get
public static SegmentPart get(org.apache.hadoop.mapred.FileSplit split) throws IOException
Create SegmentPart from a FileSplit.
- Parameters:
- <code>split</code> -
- Returns:
- A [<code>SegmentPart</code>](../../../../org/apache/nutch/segment/SegmentPart.html) resultant from a <code>FileSplit</code>.
- Throws:
- <code>Exception</code>
- <code>IOException</code>
-
get
public static SegmentPart get(String path) throws IOException
Create SegmentPart from a full path of a location inside any segment part.
- Parameters:
- <code>path</code> - full path into a segment part (may include "part-xxxxx" components)
- Returns:
- SegmentPart instance describing this part.
- Throws:
- <code>IOException</code> - 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:
- <code>string</code> - input String
- Returns:
- parsed instance of SegmentPart
- Throws:
- <code>IOException</code> - if "/" is missing.
