nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Kingson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NUTCH-1679) UpdateDb using batchId, link may override crawled page.
Date Sat, 29 Aug 2015 01:17:46 GMT

    [ https://issues.apache.org/jira/browse/NUTCH-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14720880#comment-14720880
] 

Alexander Kingson commented on NUTCH-1679:
------------------------------------------

I took a look to 1.x updateReducer. I see that it checks if url is in db and if it was fetched.

If it is in the db then its metadata is overridden.

 if (oldSet) {
      // copy metadata from old, if exists
      if (old.getMetaData().size() > 0) {
        result.putAllMetaData(old);
        // overlay with new, if any
        if (fetch.getMetaData().size() > 0)
          result.putAllMetaData(fetch);
      }
      // set the most recent valid value of modifiedTime
      if (old.getModifiedTime() > 0 && fetch.getModifiedTime() == 0) {
        result.setModifiedTime(old.getModifiedTime());
      }
    }

oldSet means it is in the db already.
    
The same logic can be added to 2.x.

Thanks.
Alex.

> UpdateDb using batchId, link may override crawled page.
> -------------------------------------------------------
>
>                 Key: NUTCH-1679
>                 URL: https://issues.apache.org/jira/browse/NUTCH-1679
>             Project: Nutch
>          Issue Type: Bug
>    Affects Versions: 2.2.1
>            Reporter: Tien Nguyen Manh
>            Priority: Blocker
>             Fix For: 2.3.1
>
>         Attachments: NUTCH-1679-2.patch, NUTCH-1679.patch
>
>
> The problem is in Hbase store, not sure about other store.
> Suppose at first crawl cycle we crawl link A, then get an outlink B.
> In second cycle we crawl link B which also has a link point to A
> In second updatedb we load only page B from store, and will add A as new link because
it doesn't know A already exist in store and will override A.
> UpdateDb must be run without batchId or we must set additionsAllowed=false
> Here are code for new page
>       page = new WebPage();
>       schedule.initializeSchedule(url, page);
>       page.setStatus(CrawlStatus.STATUS_UNFETCHED);
>       try {
>         scoringFilters.initialScore(url, page);
>       } catch (ScoringFilterException e) {
>         page.setScore(0.0f);
>       }
> new page will override old page status, score, fetchTime, fetchInterval, retries, metadata[CASH_KEY]
>  - i think we can change something here so that new page will only update one column
for example 'link' and if it is really a new page, we can initialize all above fields in generator
> - or we add operator checkAndPut to store so when add new page we will check if already
exist first



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message