Package org.apache.nutch.segment
Class SegmentChecker
java.lang.Object
org.apache.nutch.segment.SegmentChecker
Checks whether a segment is valid, or has a certain status (generated,
fetched, parsed), or can be used safely for a certain processing step
(e.g., indexing).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckSegmentDir(Path segmentPath, FileSystem fs) Check the segment to see if it is valid based on the sub directories.static booleanisIndexable(Path segmentPath, FileSystem fs) Check if the segment is indexable.static booleanisParsed(Path segment, FileSystem fs) Check the segment to see if it is has been parsed before.
-
Constructor Details
-
SegmentChecker
public SegmentChecker()
-
-
Method Details
-
isIndexable
Check if the segment is indexable. May add new check methods here.- Parameters:
segmentPath- path to an individual segment on diskfs- theFileSystemthat the segment resides on- Returns:
- true if the checks pass and the segment can be indexed, false otherwise
- Throws:
IOException- if there is an I/O error locating or checking either the segment contents or locating it on the filesystem
-
checkSegmentDir
Check the segment to see if it is valid based on the sub directories.- Parameters:
segmentPath- path to an individual segment on diskfs- theFileSystemthat the segment resides on- Returns:
- true if the checks pass false otherwise
- Throws:
IOException- if there is an I/O error locating or checking either the segment contents or locating it on the filesystem
-
isParsed
Check the segment to see if it is has been parsed before.- Parameters:
segment- path to an individual segment on diskfs- theFileSystemthat the segment resides on- Returns:
- true if the checks pass and the segment has been parsed, false otherwise
- Throws:
IOException- if there is an I/O error locating or checking either the segment contents or locating it on the filesystem
-