org.apache.nutch.host

## Class HostDb

- java.lang.Object
- - org.apache.nutch.host.HostDb

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class HostDb
      extends Object
      implements Closeable

  A caching wrapper for the host datastore.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_HOSTDB_CONCURRENCY_LEVEL`
    `static int` | `DEFAULT_LRU_SIZE`
    `static String` | `HOSTDB_CONCURRENCY_LEVEL`
    `static String` | `HOSTDB_LRU_SIZE`
    `static org.apache.commons.logging.Log` | `LOG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HostDb(Configuration conf)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `Host` | `get(String key)`
    `Host` | `getByHostName(String hostName)`
    `void` | `put(String key, Host host)`

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

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

- - ### Field Detail

    - #### LOG

          public static final org.apache.commons.logging.Log LOG

    - #### HOSTDB_LRU_SIZE

          public static final String HOSTDB_LRU_SIZE

      See Also:
        Constant Field Values

    - #### DEFAULT_LRU_SIZE

          public static final int DEFAULT_LRU_SIZE

      See Also:
        Constant Field Values

    - #### HOSTDB_CONCURRENCY_LEVEL

          public static final String HOSTDB_CONCURRENCY_LEVEL

      See Also:
        Constant Field Values

    - #### DEFAULT_HOSTDB_CONCURRENCY_LEVEL

          public static final int DEFAULT_HOSTDB_CONCURRENCY_LEVEL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HostDb

          public HostDb(Configuration conf)
                 throws org.apache.gora.util.GoraException

      Throws:
        `org.apache.gora.util.GoraException`

  - ### Method Detail

    - #### get

          public Host get(String key)
                   throws IOException

      Throws:
        `IOException`

    - #### getByHostName

          public Host getByHostName(String hostName)
                             throws IOException

      Throws:
        `IOException`

    - #### put

          public void put(String key,
                 Host host)
                   throws IOException

      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2015 The Apache Software Foundation