org.apache.nutch.crawl

## Class CrawlDb

- java.lang.Object
- - org.apache.hadoop.conf.Configured
  - - org.apache.nutch.util.NutchTool
    - - org.apache.nutch.crawl.CrawlDb

- All Implemented Interfaces:
    Configurable, Tool

      public class CrawlDb
      extends NutchTool
      implements Tool

  This class takes the output of the fetcher and updates the crawldb accordingly.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `CRAWLDB_ADDITIONS_ALLOWED`
    `static java.lang.String` | `CRAWLDB_PURGE_404`
    `static java.lang.String` | `CRAWLDB_PURGE_ORPHANS`
    `static java.lang.String` | `CURRENT_NAME`
    `static java.lang.String` | `LOCK_NAME`

    - ### Fields inherited from class org.apache.nutch.util.NutchTool

      `currentJob, currentJobNum, numJobs, results, status`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CrawlDb()`
    `CrawlDb(Configuration conf)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Job` | `createJob(Configuration config, Path crawlDb)`
    `static void` | `install(Job job, Path crawlDb)`
    `static Path` | `lock(Configuration job, Path crawlDb, boolean force)`
    `static void` | `main(java.lang.String[] args)`
    `java.util.Map<java.lang.String,java.lang.Object>` | `run(java.util.Map<java.lang.String,java.lang.Object> args, java.lang.String crawlId)` Runs the tool, using a map of arguments.
    `int` | `run(java.lang.String[] args)`
    `void` | `update(Path crawlDb, Path[] segments, boolean normalize, boolean filter)`
    `void` | `update(Path crawlDb, Path[] segments, boolean normalize, boolean filter, boolean additionsAllowed, boolean force)`

    - ### Methods inherited from class org.apache.nutch.util.NutchTool

      `getProgress, getStatus, killJob, stopJob`

    - ### Methods inherited from class org.apache.hadoop.conf.Configured

      `getConf, setConf`

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

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

    - ### Methods inherited from interface org.apache.hadoop.conf.Configurable

      `getConf, setConf`

- - ### Field Detail

    - #### CRAWLDB_ADDITIONS_ALLOWED

          public static final java.lang.String CRAWLDB_ADDITIONS_ALLOWED

      See Also:
        Constant Field Values

    - #### CRAWLDB_PURGE_404

          public static final java.lang.String CRAWLDB_PURGE_404

      See Also:
        Constant Field Values

    - #### CRAWLDB_PURGE_ORPHANS

          public static final java.lang.String CRAWLDB_PURGE_ORPHANS

      See Also:
        Constant Field Values

    - #### CURRENT_NAME

          public static final java.lang.String CURRENT_NAME

      See Also:
        Constant Field Values

    - #### LOCK_NAME

          public static final java.lang.String LOCK_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CrawlDb

          public CrawlDb()

    - #### CrawlDb

          public CrawlDb(Configuration conf)

  - ### Method Detail

    - #### update

          public void update(Path crawlDb,
                             Path[] segments,
                             boolean normalize,
                             boolean filter)
                      throws java.io.IOException,
                             java.lang.InterruptedException,
                             java.lang.ClassNotFoundException

      Throws:
        `java.io.IOException`
        `java.lang.InterruptedException`
        `java.lang.ClassNotFoundException`

    - #### update

          public void update(Path crawlDb,
                             Path[] segments,
                             boolean normalize,
                             boolean filter,
                             boolean additionsAllowed,
                             boolean force)
                      throws java.io.IOException,
                             java.lang.InterruptedException,
                             java.lang.ClassNotFoundException

      Throws:
        `java.io.IOException`
        `java.lang.InterruptedException`
        `java.lang.ClassNotFoundException`

    - #### createJob

          public static Job createJob(Configuration config,
                                      Path crawlDb)
                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### lock

          public static Path lock(Configuration job,
                                  Path crawlDb,
                                  boolean force)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### install

          public static void install(Job job,
                                     Path crawlDb)
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### run

          public int run(java.lang.String[] args)
                  throws java.lang.Exception

      Specified by:
        `run` in interface `Tool`
      Throws:
        `java.lang.Exception`

    - #### run

          public java.util.Map<java.lang.String,java.lang.Object> run(java.util.Map<java.lang.String,java.lang.Object> args,
                                                                      java.lang.String crawlId)
                                                               throws java.lang.Exception

      Description copied from class: `NutchTool`
      Runs the tool, using a map of arguments. May return results, or null.
      Specified by:
        `run` in class `NutchTool`
      Throws:
        `java.lang.Exception`

Copyright © 2019 The Apache Software Foundation