Package org.apache.nutch.hostdb

## Class HostDatum

- java.lang.Object
- - org.apache.nutch.hostdb.HostDatum

- All Implemented Interfaces:
    `Cloneable`, `Writable`

      public class HostDatum
      extends Object
      implements Writable, Cloneable

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected long` | `connectionFailures` |
    `protected long` | `dnsFailures` |
    `protected static byte[]` | `emptyMetaDataWritableSerialized` |
    `protected long` | `failures` |
    `protected long` | `fetched` |
    `protected long` | `gone` |
    `protected String` | `homepageUrl` |
    `protected Date` | `lastCheck` |
    `protected MapWritable` | `metaData` |
    `protected long` | `notModified` |
    `protected long` | `redirPerm` |
    `protected long` | `redirTemp` |
    `protected float` | `score` |
    `protected long` | `unfetched` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `HostDatum()` |
    `HostDatum​(float score)` |
    `HostDatum​(float score, Date lastCheck)` |
    `HostDatum​(float score, Date lastCheck, String homepageUrl)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Object` | `clone()` |
    `Long` | `getConnectionFailures()` |
    `Long` | `getDnsFailures()` |
    `long` | `getFetched()` |
    `long` | `getGone()` |
    `String` | `getHomepageUrl()` |
    `Date` | `getLastCheck()` |
    `MapWritable` | `getMetaData()` | Get Host metadata.
    `long` | `getNotModified()` |
    `long` | `getRedirPerm()` |
    `long` | `getRedirTemp()` |
    `float` | `getScore()` |
    `long` | `getUnfetched()` |
    `boolean` | `hasHomepageUrl()` |
    `boolean` | `hasMetaData()` |
    `void` | `incConnectionFailures()` |
    `void` | `incDnsFailures()` |
    `boolean` | `isEmpty()` |
    `Long` | `numFailures()` |
    `Long` | `numRecords()` |
    `void` | `putAllMetaData​(HostDatum other)` | Add all metadata from other HostDatum to this HostDatum.
    `void` | `readFields​(DataInput in)` |
    `void` | `resetFailures()` |
    `void` | `resetStatistics()` |
    `void` | `setConnectionFailures​(Long connectionFailures)` |
    `void` | `setDnsFailures​(Long dnsFailures)` |
    `void` | `setFetched​(long val)` |
    `void` | `setGone​(long val)` |
    `void` | `setHomepageUrl​(String homepageUrl)` |
    `void` | `setLastCheck()` |
    `void` | `setLastCheck​(Date date)` |
    `void` | `setMetaData​(MapWritable mapWritable)` |
    `void` | `setNotModified​(long val)` |
    `void` | `setRedirPerm​(long val)` |
    `void` | `setRedirTemp​(long val)` |
    `void` | `setScore​(float score)` |
    `void` | `setUnfetched​(long val)` |
    `String` | `toString()` |
    `void` | `write​(DataOutput out)` |

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

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

- - ### Field Detail

    - #### failures

          protected long failures

    - #### score

          protected float score

    - #### lastCheck

          protected Date lastCheck

    - #### homepageUrl

          protected String homepageUrl

    - #### metaData

          protected MapWritable metaData

    - #### emptyMetaDataWritableSerialized

          protected static final byte[] emptyMetaDataWritableSerialized

    - #### dnsFailures

          protected long dnsFailures

    - #### connectionFailures

          protected long connectionFailures

    - #### unfetched

          protected long unfetched

    - #### fetched

          protected long fetched

    - #### notModified

          protected long notModified

    - #### redirTemp

          protected long redirTemp

    - #### redirPerm

          protected long redirPerm

    - #### gone

          protected long gone

  - ### Constructor Detail

    - #### HostDatum

          public HostDatum()

    - #### HostDatum

          public HostDatum​(float score)

    - #### HostDatum

          public HostDatum​(float score,
                           Date lastCheck)

    - #### HostDatum

          public HostDatum​(float score,
                           Date lastCheck,
                           String homepageUrl)

  - ### Method Detail

    - #### resetFailures

          public void resetFailures()

    - #### setDnsFailures

          public void setDnsFailures​(Long dnsFailures)

    - #### setConnectionFailures

          public void setConnectionFailures​(Long connectionFailures)

    - #### incDnsFailures

          public void incDnsFailures()

    - #### incConnectionFailures

          public void incConnectionFailures()

    - #### numFailures

          public Long numFailures()

    - #### getDnsFailures

          public Long getDnsFailures()

    - #### getConnectionFailures

          public Long getConnectionFailures()

    - #### setScore

          public void setScore​(float score)

    - #### setLastCheck

          public void setLastCheck()

    - #### setLastCheck

          public void setLastCheck​(Date date)

    - #### isEmpty

          public boolean isEmpty()

    - #### getScore

          public float getScore()

    - #### numRecords

          public Long numRecords()

    - #### getLastCheck

          public Date getLastCheck()

    - #### hasHomepageUrl

          public boolean hasHomepageUrl()

    - #### getHomepageUrl

          public String getHomepageUrl()

    - #### setHomepageUrl

          public void setHomepageUrl​(String homepageUrl)

    - #### setUnfetched

          public void setUnfetched​(long val)

    - #### getUnfetched

          public long getUnfetched()

    - #### setFetched

          public void setFetched​(long val)

    - #### getFetched

          public long getFetched()

    - #### setNotModified

          public void setNotModified​(long val)

    - #### getNotModified

          public long getNotModified()

    - #### setRedirTemp

          public void setRedirTemp​(long val)

    - #### getRedirTemp

          public long getRedirTemp()

    - #### setRedirPerm

          public void setRedirPerm​(long val)

    - #### getRedirPerm

          public long getRedirPerm()

    - #### setGone

          public void setGone​(long val)

    - #### getGone

          public long getGone()

    - #### resetStatistics

          public void resetStatistics()

    - #### setMetaData

          public void setMetaData​(MapWritable mapWritable)

    - #### putAllMetaData

          public void putAllMetaData​(HostDatum other)

      Add all metadata from other HostDatum to this HostDatum.
      Parameters:
        `other` - HostDatum

    - #### getMetaData

          public MapWritable getMetaData()

      Get Host metadata.
      Returns:
        a `MapWritable` if it was set or read in `readFields(DataInput)`, OR returns empty map in case `HostDatum` was freshly created (lazily instantiated).

    - #### hasMetaData

          public boolean hasMetaData()

      Returns:
        true if host has (non-empty) metadata

    - #### clone

          public Object clone()
                       throws CloneNotSupportedException

      Overrides:
        `clone` in class `Object`
      Throws:
        `CloneNotSupportedException`

    - #### readFields

          public void readFields​(DataInput in)
                          throws IOException

      Specified by:
        `readFields` in interface `Writable`
      Throws:
        `IOException`

    - #### write

          public void write​(DataOutput out)
                     throws IOException

      Specified by:
        `write` in interface `Writable`
      Throws:
        `IOException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`