You are viewing a plain text version of this content. The canonical link for it is here.
Posted to droids-dev@incubator.apache.org by "Mingfai Ma (JIRA)" <ji...@apache.org> on 2009/05/17 21:07:45 UTC

[jira] Commented: (DROIDS-48) Support prioritizing in the TaskQueue

    [ https://issues.apache.org/jira/browse/DROIDS-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710225#action_12710225 ] 

Mingfai Ma commented on DROIDS-48:
----------------------------------

any comment to this feature?

could a weight field be added to Task? or could Task be enhanced to support a map of custom data? without adding weight to the Task interface, this feature cannot be implemented.

for the Queue, there could be diff options:
 1. include in SimpleTaskQueue as provided in this patch, or
 2. make a separated TaskQueue implementation, e.g. PrioritizedTaskQueue, or
 3. do not include in the distribution (maybe provide in any example)

re. between 1 and 2, the so-called prioritization is not too complex, so I think it is ok to include SimpleTaskQueue rather than separate to another queue, if it is to be included in the dist at all.




> Support prioritizing in the TaskQueue
> -------------------------------------
>
>                 Key: DROIDS-48
>                 URL: https://issues.apache.org/jira/browse/DROIDS-48
>             Project: Droids
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 0.01
>            Reporter: Mingfai Ma
>         Attachments: DROIDS-48b.patch, DROIDS-48c.patch
>
>
> Use case:
>  - when looping a directory, (imagine someone is too stupid and dunno the dmoz database can be downloaded and try to crawl it with Droids) we got collect a lot of links that will be handled later. assume the requirement is to fetch dmoz directory +1 link outside dmoz.org, In the original mechanism, it will keep adding new links to the TaskQueue. Ideally, there should be a mechanism to give a higher priority to the non-dmoz.org links, so when non-dmoz links are added, they are processed first, and be removed from the TaskQueue asap.
> with the patch in DROIDS-47, a constructor is added to the SimpleTaskQueue to support a custom Queue. This issue suggests to change the SimpleTaskQueue to use a PriorityBlockingQueue by default, and add a getWeight to the Task interface
> I'm also thinking about a more complex TaskQueue. to be discussed in the mail list later.

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