incubator-droids-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mingfai Ma (JIRA)" <>
Subject [jira] Commented: (DROIDS-49) Make LinkTask.started non-final, and rename it propertly
Date Thu, 23 Apr 2009 19:21:30 GMT


Mingfai Ma commented on DROIDS-49:

>what is the problem? That the times are different?

when LinkTask is created one by one during a normal crawling job, there won't be issue.

but when a large batch of LinkTask are created programmatically, such as in a unit test or
load test, (and in fact, i load a large number of links from db but do not want them to have
the same created time) all LinkTask have the same created time. 

e.g. for the prioritized queue that i've submitted in DROIDS-48, when the weight of 2 tasks
are identical, it uses the created time to determine the order. In unit test, i have to sleep
for 200ms before creating the 2nd LinkTask. (only because the started field is final). For
another test case I want to create 10,000 tasks and I gave up as it will take too long to
do the creation.

i suggest to find a way to let us change the LinkTask. if not, i have subclass LinkTask myself.

> Make LinkTask.started non-final, and rename it propertly
> --------------------------------------------------------
>                 Key: DROIDS-49
>                 URL:
>             Project: Droids
>          Issue Type: Improvement
>          Components: core
>            Reporter: Mingfai Ma
>         Attachments: DROIDS-49.patch
> started/taskDate should be final, but it caused a problem to me in doing unit test that
a huge number of LinkTask are to be created with different started date
> my suggestion:
> 1. make started non-final
> 2. add a constructor 
> by design, the 2nd one is better. but in terms of maintainability, it's better not to
add too many constructors. 
> The HttpCore design has some examples (http header of response?! sth like that) that
final attributes are not necessarily be made as final/immune. I suggest just to make the started
field non-final.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message