org.apache.nutch.crawl

## Class GeneratorJob

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

- All Implemented Interfaces:
    Configurable, Tool

      public class GeneratorJob
      extends NutchTool
      implements Tool

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GeneratorJob.SelectorEntry`
    `static class` | `GeneratorJob.SelectorEntryComparator`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `BATCH_ID`
    `static java.lang.String` | `GENERATE_COUNT`
    `static java.lang.String` | `GENERATE_UPDATE_CRAWLDB`
    `static java.lang.String` | `GENERATOR_COUNT_MODE`
    `static java.lang.String` | `GENERATOR_COUNT_VALUE_DOMAIN`
    `static java.lang.String` | `GENERATOR_COUNT_VALUE_HOST`
    `static java.lang.String` | `GENERATOR_COUNT_VALUE_IP`
    `static java.lang.String` | `GENERATOR_CUR_TIME`
    `static java.lang.String` | `GENERATOR_DELAY`
    `static java.lang.String` | `GENERATOR_FILTER`
    `static java.lang.String` | `GENERATOR_MAX_COUNT`
    `static java.lang.String` | `GENERATOR_MIN_SCORE`
    `static java.lang.String` | `GENERATOR_NORMALISE`
    `static java.lang.String` | `GENERATOR_RANDOM_SEED`
    `static java.lang.String` | `GENERATOR_SITEMAP`
    `static java.lang.String` | `GENERATOR_TOP_N`
    `protected static org.slf4j.Logger` | `LOG`

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

      `currentJob, currentJobNum, numJobs, results, status`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `generate(long topN, long curTime, boolean filter, boolean norm, boolean sitemap)` Mark URLs ready for fetching.
    `java.util.Collection<WebPage.Field>` | `getFields(Job job)`
    `static void` | `main(java.lang.String[] args)`
    `static java.lang.String` | `randomBatchId()` Generates a random batch id
    `java.util.Map<java.lang.String,java.lang.Object>` | `run(java.util.Map<java.lang.String,java.lang.Object> args)` Runs generator
    `int` | `run(java.lang.String[] args)` Runs generator from commandline

    - ### 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

    - #### GENERATE_UPDATE_CRAWLDB

          public static final java.lang.String GENERATE_UPDATE_CRAWLDB

      See Also:
        Constant Field Values

    - #### GENERATOR_MIN_SCORE

          public static final java.lang.String GENERATOR_MIN_SCORE

      See Also:
        Constant Field Values

    - #### GENERATOR_FILTER

          public static final java.lang.String GENERATOR_FILTER

      See Also:
        Constant Field Values

    - #### GENERATOR_NORMALISE

          public static final java.lang.String GENERATOR_NORMALISE

      See Also:
        Constant Field Values

    - #### GENERATOR_SITEMAP

          public static final java.lang.String GENERATOR_SITEMAP

      See Also:
        Constant Field Values

    - #### GENERATOR_MAX_COUNT

          public static final java.lang.String GENERATOR_MAX_COUNT

      See Also:
        Constant Field Values

    - #### GENERATOR_COUNT_MODE

          public static final java.lang.String GENERATOR_COUNT_MODE

      See Also:
        Constant Field Values

    - #### GENERATOR_COUNT_VALUE_DOMAIN

          public static final java.lang.String GENERATOR_COUNT_VALUE_DOMAIN

      See Also:
        Constant Field Values

    - #### GENERATOR_COUNT_VALUE_HOST

          public static final java.lang.String GENERATOR_COUNT_VALUE_HOST

      See Also:
        Constant Field Values

    - #### GENERATOR_COUNT_VALUE_IP

          public static final java.lang.String GENERATOR_COUNT_VALUE_IP

      See Also:
        Constant Field Values

    - #### GENERATOR_TOP_N

          public static final java.lang.String GENERATOR_TOP_N

      See Also:
        Constant Field Values

    - #### GENERATOR_CUR_TIME

          public static final java.lang.String GENERATOR_CUR_TIME

      See Also:
        Constant Field Values

    - #### GENERATOR_DELAY

          public static final java.lang.String GENERATOR_DELAY

      See Also:
        Constant Field Values

    - #### GENERATOR_RANDOM_SEED

          public static final java.lang.String GENERATOR_RANDOM_SEED

      See Also:
        Constant Field Values

    - #### BATCH_ID

          public static final java.lang.String BATCH_ID

      See Also:
        Constant Field Values

    - #### GENERATE_COUNT

          public static final java.lang.String GENERATE_COUNT

      See Also:
        Constant Field Values

    - #### LOG

          protected static final org.slf4j.Logger LOG

  - ### Constructor Detail

    - #### GeneratorJob

          public GeneratorJob()

    - #### GeneratorJob

          public GeneratorJob(Configuration conf)

  - ### Method Detail

    - #### getFields

          public java.util.Collection<WebPage.Field> getFields(Job job)

    - #### randomBatchId

          public static java.lang.String randomBatchId()

      Generates a random batch id
      Returns:
        random batch id

    - #### run

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

      Runs generator
      Specified by:
        `run` in class `NutchTool`
      Parameters:
        `args` - map of arguments
      Returns:
        results
      Throws:
        `java.lang.Exception`

    - #### generate

          public java.lang.String generate(long topN,
                                           long curTime,
                                           boolean filter,
                                           boolean norm,
                                           boolean sitemap)
                                    throws java.lang.Exception

      Mark URLs ready for fetching.
      Parameters:
        `topN` - top threshold for maximum number of URLs permitted in a batch
        `curTime` - the current time in milliseconds
        `filter` - optional filtering of URLs within the generated batch
        `norm` - optional normalization of URls within the generated batch
        `sitemap` - flag indicating whether a URL is a sitemap and hence processed accordingly
      Throws:
        `java.lang.Exception`

    - #### run

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

      Runs generator from commandline
      Specified by:
        `run` in interface `Tool`
      Parameters:
        `args` - arguments
      Returns:
        returns -1
      Throws:
        `java.lang.Exception`

    - #### main

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

      Throws:
        `java.lang.Exception`

Copyright © 2019 The Apache Software Foundation