public class CrawlHost extends Object implements Serializable, FetchStats.HasFetchStats, IdentityCacheable
Modifier and Type | Field and Description |
---|---|
static long |
IP_NEVER_EXPIRES
Flag value indicating always-valid IP
|
static long |
IP_NEVER_LOOKED_UP
Flag value indicating an IP has not yet been looked up
|
protected FetchStats |
substats |
Constructor and Description |
---|
CrawlHost(String hostname)
Create a new CrawlHost object.
|
CrawlHost(String hostname,
String countryCode)
Create a new CrawlHost object.
|
Modifier and Type | Method and Description |
---|---|
static void |
autoregisterTo(AutoKryo kryo) |
boolean |
equals(Object obj) |
String |
getCountryCode()
Get country code of this host
|
long |
getEarliestNextURIEmitTime()
Get the earliest time a URI for this host could be emitted.
|
String |
getHostName()
Get the host name.
|
InetAddress |
getIP()
Get the IP address for this host.
|
long |
getIpFetched()
Get the time when the IP address for this host was last looked up.
|
long |
getIpTTL()
Get the TTL value from the dns record for this host.
|
String |
getKey() |
FetchStats |
getSubstats() |
boolean |
hasBeenLookedUp()
Return true if the IP for this host has been looked up.
|
int |
hashCode() |
void |
makeDirty() |
void |
setCountryCode(String countryCode)
Set country code for this hos
|
void |
setEarliestNextURIEmitTime(long earliestNextURIEmitTime)
Set the earliest time a URI for this host could be emitted.
|
void |
setIdentityCache(ObjectIdentityCache<?> cache) |
void |
setIP(InetAddress address,
long ttl)
Set the IP address for this host.
|
String |
toString() |
public static final long IP_NEVER_EXPIRES
public static final long IP_NEVER_LOOKED_UP
protected FetchStats substats
public CrawlHost(String hostname)
hostname
- the host name for this host.public boolean hasBeenLookedUp()
public void setIP(InetAddress address, long ttl)
address
- ttl
- the TTL from the dns record in seconds or -1 if it should live
forever (is a numeric IP).public InetAddress getIP()
public long getIpFetched()
public long getIpTTL()
public String getHostName()
public long getEarliestNextURIEmitTime()
public void setEarliestNextURIEmitTime(long earliestNextURIEmitTime)
earliestNextURIEmitTime
- The earliestNextURIEmitTime to set.public String getCountryCode()
public void setCountryCode(String countryCode)
countryCode
- The country code of this hostpublic FetchStats getSubstats()
getSubstats
in interface FetchStats.HasFetchStats
public static void autoregisterTo(AutoKryo kryo)
public String getKey()
getKey
in interface IdentityCacheable
public void makeDirty()
makeDirty
in interface IdentityCacheable
public void setIdentityCache(ObjectIdentityCache<?> cache)
setIdentityCache
in interface IdentityCacheable
Copyright © 2003-2014 Internet Archive. All Rights Reserved.