org.apache.nutch.host

## Class HostDb

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

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

      public class HostDb
      extends java.lang.Object
      implements java.io.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 java.lang.String` | `HOSTDB_CONCURRENCY_LEVEL`
    `static java.lang.String` | `HOSTDB_LRU_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HostDb(Configuration conf)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `Host` | `get(java.lang.String key)`
    `Host` | `getByHostName(java.lang.String hostName)`
    `void` | `put(java.lang.String key, Host host)`

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

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

- - ### Field Detail

    - #### HOSTDB_LRU_SIZE

          public static final java.lang.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 java.lang.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(java.lang.String key)
                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getByHostName

          public Host getByHostName(java.lang.String hostName)
                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### put

          public void put(java.lang.String key,
                          Host host)
                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### close

          public void close()
                     throws java.io.IOException

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Throws:
        `java.io.IOException`

Copyright © 2019 The Apache Software Foundation