public class RedisPriorityScheduler extends RedisScheduler
pool
logger
Constructor and Description |
---|
RedisPriorityScheduler(redis.clients.jedis.JedisPool pool) |
RedisPriorityScheduler(String host) |
Modifier and Type | Method and Description |
---|---|
Request |
poll(Task task)
get an url to crawl
|
protected void |
pushWhenNoDuplicate(Request request,
Task task) |
void |
resetDuplicateCheck(Task task)
Reset duplicate check.
|
getItemKey, getLeftRequestsCount, getQueueKey, getSetKey, getTotalRequestsCount, isDuplicate
getDuplicateRemover, noNeedToRemoveDuplicate, push, setDuplicateRemover, shouldReserved
public RedisPriorityScheduler(String host)
public RedisPriorityScheduler(redis.clients.jedis.JedisPool pool)
protected void pushWhenNoDuplicate(Request request, Task task)
pushWhenNoDuplicate
in class RedisScheduler
public Request poll(Task task)
Scheduler
poll
in interface Scheduler
poll
in class RedisScheduler
task
- the task of spiderpublic void resetDuplicateCheck(Task task)
DuplicateRemover
resetDuplicateCheck
in interface DuplicateRemover
resetDuplicateCheck
in class RedisScheduler
task
- taskCopyright © 2017. All rights reserved.