Package org.apache.nutch.fetcher
Class FetcherThreadEvent
java.lang.Object
org.apache.nutch.fetcher.FetcherThreadEvent
- All Implemented Interfaces:
Serializable
This class is used to capture the various events occurring
at fetch time. These events are sent to a
NutchPublisher implementation.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of event to specify start, end or reporting of a fetch item. -
Constructor Summary
ConstructorsConstructorDescriptionFetcherThreadEvent(FetcherThreadEvent.PublishEventType eventType, String url) Constructor to create an event to be published -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventData(String key, Object value) Add new data to the eventData object.voidaddOutlinksToEventData(Collection<Outlink> links) Given a collection of lists this method will add it the oultink metadataGet event dataGet type of this event objectGet timestamp of current event.getUrl()Get URL of this eventvoidsetEventData(Map<String, Object> eventData) Set metadata to this evenvoidsetEventType(FetcherThreadEvent.PublishEventType eventType) Set event type of this objectvoidsetTimestamp(Long timestamp) Set timestamp for this eventvoidSet URL of this event (fetched page)
-
Constructor Details
-
FetcherThreadEvent
Constructor to create an event to be published- Parameters:
eventType- Type ofeventbeing createdurl- URL of the fetched page to which this event belongs to
-
-
Method Details
-
getEventType
Get type of this event object- Returns:
Eventtype
-
setEventType
Set event type of this object- Parameters:
eventType- Seteventtype
-
getEventData
Get event data- Returns:
- a Map of event data
-
setEventData
Set metadata to this even- Parameters:
eventData- A map containing important information relevant to this event (fetched page). Exeample - score, title, outlinks, content-type, etc
-
getUrl
Get URL of this event- Returns:
URLof this event
-
setUrl
Set URL of this event (fetched page)- Parameters:
url- URL of the fetched page
-
addEventData
Add new data to the eventData object.- Parameters:
key- A key to refer to the data being added to this eventvalue- Data to be stored in the event referenced by the above key
-
addOutlinksToEventData
Given a collection of lists this method will add it the oultink metadata- Parameters:
links- A collection of outlinks generating from the fetched page this event refers to
-
getTimestamp
Get timestamp of current event.- Returns:
Timestamp
-
setTimestamp
Set timestamp for this event- Parameters:
timestamp- Timestamp of the occurrence of this event
-