org.apache.nutch.hostdb

## Class UpdateHostDbReducer

- java.lang.Object
- - org.apache.hadoop.mapreduce.Reducer<Text,NutchWritable,Text,HostDatum>
  - - org.apache.nutch.hostdb.UpdateHostDbReducer

-     public class UpdateHostDbReducer
      extends Reducer<Text,NutchWritable,Text,HostDatum>

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer

      `Reducer.Context`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static boolean` | `checkFailed`
    `protected static boolean` | `checkKnown`
    `protected static boolean` | `checkNew`
    `protected java.util.concurrent.ThreadPoolExecutor` | `executor`
    `protected static boolean` | `force`
    `protected static long` | `now`
    `protected static java.lang.String[]` | `numericFields`
    `protected static Text[]` | `numericFieldWritables`
    `protected java.lang.Integer` | `numResolverThreads`
    `protected static int[]` | `percentiles`
    `protected static java.lang.Integer` | `purgeFailedHostsThreshold`
    `protected java.util.concurrent.BlockingQueue<java.lang.Runnable>` | `queue`
    `protected static java.lang.Integer` | `recheckInterval`
    `protected ResolverThread` | `resolverThread`
    `protected static java.lang.String[]` | `stringFields`
    `protected static Text[]` | `stringFieldWritables`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UpdateHostDbReducer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanup(Reducer.Context context)` Shut down all running threads and wait for completion.
    `protected boolean` | `isEligibleForCheck(HostDatum datum)` Determines whether a record is eligible for recheck.
    `void` | `reduce(Text key, java.lang.Iterable<NutchWritable> values, Reducer.Context context)`
    `void` | `setup(Reducer.Context context)` Configures the thread pool and prestarts all resolver threads.
    `protected boolean` | `shouldCheck(HostDatum datum)` Determines whether a record should be checked.

    - ### Methods inherited from class org.apache.hadoop.mapreduce.Reducer

      `run`

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

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

- - ### Field Detail

    - #### resolverThread

          protected ResolverThread resolverThread

    - #### numResolverThreads

          protected java.lang.Integer numResolverThreads

    - #### purgeFailedHostsThreshold

          protected static java.lang.Integer purgeFailedHostsThreshold

    - #### recheckInterval

          protected static java.lang.Integer recheckInterval

    - #### checkFailed

          protected static boolean checkFailed

    - #### checkNew

          protected static boolean checkNew

    - #### checkKnown

          protected static boolean checkKnown

    - #### force

          protected static boolean force

    - #### now

          protected static long now

    - #### numericFields

          protected static java.lang.String[] numericFields

    - #### stringFields

          protected static java.lang.String[] stringFields

    - #### percentiles

          protected static int[] percentiles

    - #### numericFieldWritables

          protected static Text[] numericFieldWritables

    - #### stringFieldWritables

          protected static Text[] stringFieldWritables

    - #### queue

          protected java.util.concurrent.BlockingQueue<java.lang.Runnable> queue

    - #### executor

          protected java.util.concurrent.ThreadPoolExecutor executor

  - ### Constructor Detail

    - #### UpdateHostDbReducer

          public UpdateHostDbReducer()

  - ### Method Detail

    - #### setup

          public void setup(Reducer.Context context)

      Configures the thread pool and prestarts all resolver threads.
      Overrides:
        `setup` in class `Reducer<Text,NutchWritable,Text,HostDatum>`

    - #### reduce

          public void reduce(Text key,
                             java.lang.Iterable<NutchWritable> values,
                             Reducer.Context context)
                      throws java.io.IOException,
                             java.lang.InterruptedException

      Overrides:
        `reduce` in class `Reducer<Text,NutchWritable,Text,HostDatum>`
      Throws:
        `java.io.IOException`
        `java.lang.InterruptedException`

    - #### shouldCheck

          protected boolean shouldCheck(HostDatum datum)

      Determines whether a record should be checked.
      Parameters:
        `datum` -
      Returns:
        boolean

    - #### isEligibleForCheck

          protected boolean isEligibleForCheck(HostDatum datum)

      Determines whether a record is eligible for recheck.
      Parameters:
        `datum` -
      Returns:
        boolean

    - #### cleanup

          public void cleanup(Reducer.Context context)

      Shut down all running threads and wait for completion.
      Overrides:
        `cleanup` in class `Reducer<Text,NutchWritable,Text,HostDatum>`

Copyright © 2019 The Apache Software Foundation