You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by RS <ti...@163.com> on 2013/07/07 11:13:32 UTC

how about change a liite in the QueueFeeder

Hello:
    In the org.apache.nutch.fetcher.FetcherReducer.QueueFeeder Class, there is a run methmod.
    I wan to make It look like more simply, maybe.


    public void run() {
         ...   
        while (hasMore) {
+        currentIter = context.getValues().iterator();
          if (System.currentTimeMillis() >= timelimit && timelimit != -1) {
            // enough .. lets' simply
            // read all the entries from the input without processing them
            while (currentIter.hasNext()) {
              currentIter.next();
              timelimitcount++;
            }
            hasMore = context.nextKey();
-           if (hasMore) {
-            currentIter = context.getValues().iterator();
-           }
            continue;
          }
         ...
        if (currentIter.hasNext()) {
            continue; // finish items in current list before reading next key
          }
          hasMore = context.nextKey();
-         if (hasMore) {
-           currentIter = context.getValues().iterator();
-         }
        }   ...


Thanks 
HeChuan

RE: how about change a liite in the QueueFeeder

Posted by Markus Jelsma <ma...@openindex.io>.
H,

What exactly is the problem you're trying to solve? If there's an issue, please open a Jira ticket, describe the problem and attach a patch file.

Thanks
Markus

 
 
-----Original message-----
> From:RS <ti...@163.com>
> Sent: Sunday 7th July 2013 11:14
> To: Lewis John&nbspMcgibbney <le...@gmail.com>
> Cc: nutch-user <us...@nutch.apache.org>
> Subject: how about change a liite in the QueueFeeder
> 
> Hello:
>     In the org.apache.nutch.fetcher.FetcherReducer.QueueFeeder Class, there is a run methmod.
>     I wan to make It look like more simply, maybe.
> 
> 
>     public void run() {
>          ...   
>         while (hasMore) {
> +        currentIter = context.getValues().iterator();
>           if (System.currentTimeMillis() >= timelimit && timelimit != -1) {
>             // enough .. lets' simply
>             // read all the entries from the input without processing them
>             while (currentIter.hasNext()) {
>               currentIter.next();
>               timelimitcount++;
>             }
>             hasMore = context.nextKey();
> -           if (hasMore) {
> -            currentIter = context.getValues().iterator();
> -           }
>             continue;
>           }
>          ...
>         if (currentIter.hasNext()) {
>             continue; // finish items in current list before reading next key
>           }
>           hasMore = context.nextKey();
> -         if (hasMore) {
> -           currentIter = context.getValues().iterator();
> -         }
>         }   ...
> 
> 
> Thanks 
> HeChuan