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

Semyon Semyonov edited comment on NUTCH-2481 at 1/25/18 4:19 PM:
-----------------------------------------------------------------

An example of usage.

For example to use fetched deltas in generate.

1) To calculate FetchedDelta in the hostdb update
 <property>
 <name>hostdb.deltaExpression</name>
 <value>\{return new ("javafx.util.Pair","FetchedDelta", 
currentHostDatum.fetched - previousHostDatum.fetched);}</value>
 </property>

2) To use FetchedDelta in generate to not crawl the websites with FetchedDelta 
< 5

<property>
<name>generate.max.count.expr</name> 
<value> if(fetched > 70 &#038;&#038; FetchedDelta &#60; 5 ) \{return 
new("java.lang.Double", 0);} else \{return conf.getDouble("generate.max.count", 
-1);} </value>
</property>

 


was (Author: semyon.semyo...@mail.com):
An example of usage.

For example to use fetched deltas in generate.

1) To calculate FetchedDelta in the hostdb update
<property>
 <name>hostdb.deltaExpression</name>
 <value>\{return new ("javafx.util.Pair","FetchedDelta", 
currentHostDatum.fetched - previousHostDatum.fetched);}</value>
</property>

2) To use FetchedDelta in generate to not crawl the websites with FetchedDelta 
< 5

<property>
 <name>generate.max.count.expr</name> 
<value> if(fetched > 70 &#038;&#038; FetchedDelta &#60; 5 ) \{return 
new("java.lang.Double", 0);} else \{return conf.getDouble("generate.max.count", 
-1);} </value>
</property>

 

> HostDatum deltas(previous step statistics) and Metadata expressions
> -------------------------------------------------------------------
>
>                 Key: NUTCH-2481
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2481
>             Project: Nutch
>          Issue Type: Improvement
>          Components: hostdb
>            Reporter: Semyon Semyonov
>            Priority: Minor
>
> To allow the usage of previous step statistics(deltas of fetched,unfetced 
> etc) in hostdb. The motivation is usage of this statistics in generate with 
> maxCount expressions.
>  
> The solution allows to fill in metadata of hostdatum based on custom JEXL 
> expression using two hostdatum: before update(previousHostDatum) and after 
> update(currentHostDatum)..
> For example to fill in difference in quantity of fetched at round t and t-1 
> we can use the following expression
> <property>
>  <name>hostdb.deltaExpression</name>
>  <value>\{return new ("javafx.util.Pair","FetchedDelta", 
> currentHostDatum.fetched - previousHostDatum.fetched);}</value>
> </property>
> A pull request will be provided shortly.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to