org.apache.nutch.segment

## Class SegmentChecker

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

-     public class SegmentChecker
      extends Object

  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
    Constructor and Description
    `SegmentChecker()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `checkSegmentDir(Path segmentPath, FileSystem fs)` Check the segment to see if it is valid based on the sub directories.
    `static boolean` | `isIndexable(Path segmentPath, FileSystem fs)` Check if the segment is indexable.
    `static boolean` | `isParsed(Path segment, FileSystem fs)` Check the segment to see if it is has been parsed before.

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

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

- - ### Constructor Detail

    - #### SegmentChecker

          public SegmentChecker()

  - ### Method Detail

    - #### isIndexable

          public static boolean isIndexable(Path segmentPath,
                                            FileSystem fs)
                                     throws IOException

      Check if the segment is indexable. May add new check methods here.
      Throws:
        `IOException`

    - #### checkSegmentDir

          public static boolean checkSegmentDir(Path segmentPath,
                                                FileSystem fs)
                                         throws IOException

      Check the segment to see if it is valid based on the sub directories.
      Throws:
        `IOException`

    - #### isParsed

          public static boolean isParsed(Path segment,
                                         FileSystem fs)
                                  throws IOException

      Check the segment to see if it is has been parsed before.
      Throws:
        `IOException`

Copyright © 2021 The Apache Software Foundation