org.apache.nutch.fetcher

## Class FetchItemQueues

- java.lang.Object
- - org.apache.nutch.fetcher.FetchItemQueues

-     public class FetchItemQueues
      extends java.lang.Object

  Convenience class - a collection of queues that keeps track of the total number of items, and provides items eligible for fetching from any queue.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_ID`
    `static java.lang.String` | `QUEUE_MODE_DOMAIN`
    `static java.lang.String` | `QUEUE_MODE_HOST`
    `static java.lang.String` | `QUEUE_MODE_IP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FetchItemQueues(Configuration conf)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addFetchItem(FetchItem it)`
    `void` | `addFetchItem(Text url, CrawlDatum datum)`
    `int` | `checkExceptionThreshold(java.lang.String queueid)` Increment the exception counter of a queue in case of an exception e.g.
    `protected static java.lang.String` | `checkQueueMode(java.lang.String queueMode)` Check whether queue mode is valid, fall-back to default mode if not.
    `int` | `checkTimelimit()`
    `void` | `dump()`
    `int` | `emptyQueues()`
    `void` | `finishFetchItem(FetchItem it)`
    `void` | `finishFetchItem(FetchItem it, boolean asap)`
    `FetchItem` | `getFetchItem()`
    `FetchItemQueue` | `getFetchItemQueue(java.lang.String id)`
    `int` | `getQueueCount()`
    `int` | `getTotalSize()`

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

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

- - ### Field Detail

    - #### DEFAULT_ID

          public static final java.lang.String DEFAULT_ID

      See Also:
        Constant Field Values

    - #### QUEUE_MODE_HOST

          public static final java.lang.String QUEUE_MODE_HOST

      See Also:
        Constant Field Values

    - #### QUEUE_MODE_DOMAIN

          public static final java.lang.String QUEUE_MODE_DOMAIN

      See Also:
        Constant Field Values

    - #### QUEUE_MODE_IP

          public static final java.lang.String QUEUE_MODE_IP

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FetchItemQueues

          public FetchItemQueues(Configuration conf)

  - ### Method Detail

    - #### checkQueueMode

          protected static java.lang.String checkQueueMode(java.lang.String queueMode)

      Check whether queue mode is valid, fall-back to default mode if not.
      Parameters:
        `queueMode` - queue mode to check
      Returns:
        valid queue mode or default

    - #### getTotalSize

          public int getTotalSize()

    - #### getQueueCount

          public int getQueueCount()

    - #### addFetchItem

          public void addFetchItem(Text url,
                                   CrawlDatum datum)

    - #### addFetchItem

          public void addFetchItem(FetchItem it)

    - #### finishFetchItem

          public void finishFetchItem(FetchItem it)

    - #### finishFetchItem

          public void finishFetchItem(FetchItem it,
                                      boolean asap)

    - #### getFetchItemQueue

          public FetchItemQueue getFetchItemQueue(java.lang.String id)

    - #### getFetchItem

          public FetchItem getFetchItem()

    - #### checkTimelimit

          public int checkTimelimit()

    - #### emptyQueues

          public int emptyQueues()

    - #### checkExceptionThreshold

          public int checkExceptionThreshold(java.lang.String queueid)

      Increment the exception counter of a queue in case of an exception e.g. timeout; when higher than a given threshold simply empty the queue.
      Parameters:
        `queueid` -
      Returns:
        number of purged items

    - #### dump

          public void dump()

Copyright © 2019 The Apache Software Foundation