public class FetcherThreadEvent extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
FetcherThreadEvent.PublishEventType
Type of event to specify start, end or reporting of a fetch item.
|
Constructor and Description |
---|
FetcherThreadEvent(FetcherThreadEvent.PublishEventType eventType,
String url)
Constructor to create an event to be published
|
Modifier and Type | Method and Description |
---|---|
void |
addEventData(String key,
Object value)
Add new data to the eventData object.
|
void |
addOutlinksToEventData(Collection<Outlink> links)
Given a collection of lists this method will add it
the oultink metadata
|
Map<String,Object> |
getEventData()
Get event data
|
FetcherThreadEvent.PublishEventType |
getEventType()
Get type of this event object
|
Long |
getTimestamp()
Get timestamp of current event.
|
String |
getUrl()
Get URL of this event
|
void |
setEventData(Map<String,Object> eventData)
Set metadata to this even
|
void |
setEventType(FetcherThreadEvent.PublishEventType eventType)
Set event type of this object
|
void |
setTimestamp(Long timestamp)
Set timestamp for this event
|
void |
setUrl(String url)
Set URL of this event (fetched page)
|
public FetcherThreadEvent(FetcherThreadEvent.PublishEventType eventType, String url)
eventType
- Type of event
being createdurl
- URL of the fetched page to which this event belongs topublic FetcherThreadEvent.PublishEventType getEventType()
Event
typepublic void setEventType(FetcherThreadEvent.PublishEventType eventType)
eventType
- Set event
typepublic void setEventData(Map<String,Object> eventData)
eventData
- A map containing important information relevant
to this event (fetched page).
Ex - score, title, outlinks, content-type, etcpublic void setUrl(String url)
url
- URL of the fetched pagepublic void addEventData(String key, Object value)
key
- A key to refer to the data being added to this eventvalue
- Data to be stored in the event referenced by the above keypublic void addOutlinksToEventData(Collection<Outlink> links)
links
- A collection of outlinks generating from the fetched page
this event refers topublic void setTimestamp(Long timestamp)
timestamp
- Timestamp of the occurrence of this eventCopyright © 2021 The Apache Software Foundation